1 | <?php
|
---|
2 | /**************************************************************************\
|
---|
3 | * phpGroupWare - preferences *
|
---|
4 | * http://www.phpgroupware.org *
|
---|
5 | * Written by Joseph Engo <jengo@phpgroupware.org> *
|
---|
6 | * -------------------------------------------- *
|
---|
7 | * This program is free software; you can redistribute it and/or modify it *
|
---|
8 | * under the terms of the GNU General Public License as published by the *
|
---|
9 | * Free Software Foundation; either version 2 of the License, or (at your *
|
---|
10 | * option) any later version. *
|
---|
11 | \**************************************************************************/
|
---|
12 | ini_set("display_errors","1");
|
---|
13 |
|
---|
14 | $GLOBALS['phpgw_info']['flags'] = array(
|
---|
15 | 'noheader' => True,
|
---|
16 | 'nonavbar' => True,
|
---|
17 | 'currentapp' => 'preferences'
|
---|
18 | );
|
---|
19 |
|
---|
20 |
|
---|
21 | include('../header.inc.php');
|
---|
22 |
|
---|
23 | $GLOBALS['phpgw']->template->set_file(array(
|
---|
24 | 'form' => 'termo_aceite.tpl'
|
---|
25 | ));
|
---|
26 |
|
---|
27 | $termo = $GLOBALS['phpgw_info']['server']['agree_term'];
|
---|
28 |
|
---|
29 | $GLOBALS['phpgw']->template->set_var('accept_term',$termo);
|
---|
30 | $GLOBALS['phpgw']->template->set_var('Yes',lang('Yes'));
|
---|
31 | $GLOBALS['phpgw']->template->set_var('No',lang('No'));
|
---|
32 | $GLOBALS['phpgw']->template->set_var('url_accept',lang('Change'));
|
---|
33 | $GLOBALS['phpgw']->template->set_var('url_dont_accept','/logout.php');
|
---|
34 | $GLOBALS['phpgw']->template->set_var('do you agree with the terms?',lang('Do you agree with the terms?'));
|
---|
35 |
|
---|
36 |
|
---|
37 |
|
---|
38 | if (isset($_POST['pass']))
|
---|
39 | {
|
---|
40 | $ldapManager = CreateObject('contactcenter.bo_ldap_manager');
|
---|
41 | $srcs = $ldapManager->get_all_ldap_sources();
|
---|
42 | $common = CreateObject('phpgwapi.common');
|
---|
43 |
|
---|
44 | /*echo $srcs[1]['host']."----".$srcs[1]['dn']."----".$srcs[1]['pw'];
|
---|
45 | exit(0);*/
|
---|
46 |
|
---|
47 | $ldap =$common->ldapConnect($srcs[1]['host'],$srcs[1]['acc'],$srcs[1]['pw'],false);
|
---|
48 |
|
---|
49 |
|
---|
50 | $ldap_mod_replace['phpgwAgreeTerm'] = 1;
|
---|
51 | $dn = $GLOBALS['phpgw_info']['user']['account_dn'];
|
---|
52 |
|
---|
53 | ldap_mod_replace ( $ldap, $dn, $ldap_mod_replace );
|
---|
54 |
|
---|
55 | header("location: ../home.php?cd=yes");
|
---|
56 | }
|
---|
57 | else
|
---|
58 | {
|
---|
59 | $GLOBALS['phpgw_info']['flags']['app_header'] = lang('agree term');
|
---|
60 | $GLOBALS['phpgw']->common->phpgw_header();
|
---|
61 | echo parse_navbar();
|
---|
62 |
|
---|
63 | $GLOBALS['phpgw']->template->pfp('out','form');
|
---|
64 | $GLOBALS['phpgw']->common->phpgw_footer();
|
---|
65 | }
|
---|
66 | ?>
|
---|