forked from extern/egroupware
setup_demo now works for LDAP (here anyway) and still works for SQL; now uses
the accounts classes in phpgw; This is devel CVS, please test ;)
This commit is contained in:
parent
fbce45e2f2
commit
8df4163cab
@ -307,19 +307,29 @@
|
||||
lang('LDAP account import/export'),
|
||||
'POST','ldap.php',
|
||||
'submit',lang('Configure Now'),
|
||||
'');
|
||||
$link_make_accts = ' ';
|
||||
''
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$btn_config_ldap = '';
|
||||
}
|
||||
$phpgw_setup->db->query("select config_value FROM phpgw_config WHERE config_name='webserver_url'");
|
||||
$phpgw_setup->db->next_record();
|
||||
if ($phpgw_setup->db->f(0))
|
||||
{
|
||||
$link_make_accts = $phpgw_setup->make_href_link_simple(
|
||||
'<br>',
|
||||
'setup_demo.php',
|
||||
lang('Click Here'),
|
||||
lang('to setup 1 admin account and 3 demo accounts.<br><b>This will delete all existing accounts</b>')
|
||||
. ' ' . lang('(account deletion in SQL Only)')
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$link_make_accts = ' ';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,3 +1,4 @@
|
||||
(account deletion in SQL Only) setup en (account deletion in SQL Only)
|
||||
<br><center>Import has been completed! Click <a href="index.php">here</a> to return to setup </center> setup en <br><center>Import has been completed! Click <a href="index.php">here</a> to return to setup </center>
|
||||
Add auto-created users to this group ('Default' will be attempted if this is empty.) setup en Add auto-created users to this group ('Default' will be attempted if this is empty.)
|
||||
Admins setup en Admins
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
// Little file to setup a demo install
|
||||
|
||||
$phpgw_info['flags'] = array(
|
||||
$GLOBALS['phpgw_info']['flags'] = array(
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'currentapp' => "home",
|
||||
@ -30,7 +30,23 @@ if (!$phpgw_setup->auth('Config'))
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!$submit)
|
||||
function add_account($username,$first,$last,$passwd,$type='u')
|
||||
{
|
||||
$account_info = array(
|
||||
'account_type' => $type,
|
||||
'account_lid' => $username,
|
||||
'account_passwd' => $passwd,
|
||||
'account_firstname' => $first,
|
||||
'account_lastname' => $last,
|
||||
'account_status' => 'A',
|
||||
'account_expires' => -1
|
||||
);
|
||||
$GLOBALS['phpgw']->accounts->create($account_info);
|
||||
|
||||
return $GLOBALS['phpgw']->accounts->name2id($username);
|
||||
}
|
||||
|
||||
if (!$HTTP_POST_VARS['submit'])
|
||||
{
|
||||
$tpl_root = $phpgw_setup->setup_tpl_dir('setup');
|
||||
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
|
||||
@ -48,7 +64,9 @@ if (!$submit)
|
||||
$phpgw_setup->show_header(lang('Demo Server Setup'));
|
||||
|
||||
$setup_tpl->set_var('action_url','setup_demo.php');
|
||||
$setup_tpl->set_var('description',lang('This will create 1 admin account and 3 demo accounts<br>The username/passwords are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!THIS WILL DELETE ALL EXISTING ACCOUNTS!!!</b><br>'));
|
||||
$setup_tpl->set_var('description',lang('This will create 1 admin account and 3 demo accounts<br>The username/passwords are: demo/guest, demo2/guest and demo3/guest.<br><b>!!!THIS WILL DELETE ALL EXISTING ACCOUNTS!!!</b><br>')
|
||||
. ' '. lang('(account deletion in SQL only)'
|
||||
));
|
||||
$setup_tpl->set_var('detailadmin',lang('Details for Admin account'));
|
||||
$setup_tpl->set_var('adminusername',lang('Admin username'));
|
||||
$setup_tpl->set_var('adminfirstname',lang('Admin first name'));
|
||||
@ -63,6 +81,13 @@ if (!$submit)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Posted admin data */
|
||||
$passwd = $HTTP_POST_VARS['passwd'];
|
||||
$passwd2 = $HTTP_POST_VARS['passwd2'];
|
||||
$username = $HTTP_POST_VARS['username'];
|
||||
$fname = $HTTP_POST_VARS['fname'];
|
||||
$lname = $HTTP_POST_VARS['lname'];
|
||||
|
||||
if ($passwd != $passwd2)
|
||||
{
|
||||
echo lang('Passwords did not match, please re-enter') . '.';
|
||||
@ -75,100 +100,111 @@ else
|
||||
}
|
||||
|
||||
$phpgw_setup->loaddb();
|
||||
/* Load up some configured values */
|
||||
$phpgw_setup->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%' OR config_name='account_repository'",__LINE__,__FILE__);
|
||||
while ($phpgw_setup->db->next_record())
|
||||
{
|
||||
$config[$phpgw_setup->db->f('config_name')] = $phpgw_setup->db->f('config_value');
|
||||
}
|
||||
$GLOBALS['phpgw_info']['server']['ldap_host'] = $config['ldap_host'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_context'] = $config['ldap_context'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_group_context'] = $config['ldap_group_context'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_root_dn'] = $config['ldap_root_dn'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_root_pw'] = $config['ldap_root_pw'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_extra_attributes'] = $config['ldap_extra_attributes'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_account_home'] = $config['ldap_account_home'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_account_shell'] = $config['ldap_account_shell'];
|
||||
$GLOBALS['phpgw_info']['server']['ldap_encryption_type'] = $config['ldap_encryption_type'];
|
||||
$GLOBALS['phpgw_info']['server']['account_repository'] = $config['account_repository'];
|
||||
unset($config);
|
||||
|
||||
/* Create dummy class, then accounts object */
|
||||
class phpgw
|
||||
{
|
||||
var $db;
|
||||
var $common;
|
||||
var $accounts;
|
||||
}
|
||||
$GLOBALS['phpgw'] = new phpgw;
|
||||
$GLOBALS['phpgw']->db = $phpgw_setup->db;
|
||||
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
|
||||
$GLOBALS['phpgw']->accounts = CreateObject('phpgwapi.accounts');
|
||||
|
||||
/* Begin transaction for acl, etc */
|
||||
$phpgw_setup->db->transaction_begin();
|
||||
|
||||
/* First clear out existing tables */
|
||||
$phpgw_setup->db->query("delete from phpgw_accounts");
|
||||
$phpgw_setup->db->query("delete from phpgw_preferences");
|
||||
$phpgw_setup->db->query("delete from phpgw_acl");
|
||||
/* Now, clear out existing tables */
|
||||
$phpgw_setup->db->query('DELETE FROM phpgw_accounts');
|
||||
$phpgw_setup->db->query('DELETE FROM phpgw_preferences');
|
||||
$phpgw_setup->db->query('DELETE FROM phpgw_acl');
|
||||
|
||||
$defaultprefs = 'a:5:{s:6:"common";a:10:{s:9:"maxmatchs";s:2:"15";s:12:"template_set";s:8:"verdilak";s:5:"theme";s:6:"purple";s:13:"navbar_format";s:5:"icons";s:9:"tz_offset";N;s:10:"dateformat";s:5:"m/d/Y";s:10:"timeformat";s:2:"12";s:4:"lang";s:2:"en";s:11:"default_app";N;s:8:"currency";s:1:"$";}s:11:"addressbook";a:1:{s:0:"";s:4:"True";}:s:8:"calendar";a:4:{s:13:"workdaystarts";s:1:"7";s:11:"workdayends";s:2:"15";s:13:"weekdaystarts";s:6:"Monday";s:15:"defaultcalendar";s:9:"month.php";}}';
|
||||
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('Default', 'g', '".md5($passwd)."', 'Default', 'Group', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$defaultgroupid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('Admins', 'g', '".md5($passwd)."', 'Admin', 'Group', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$admingroupid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
/* Create the demo groups */
|
||||
$defaultgroupid = add_account('Default','Default','Group',$passwd,'g');
|
||||
$admingroupid = add_account('Admins','Admin', 'Group',$passwd,'g');
|
||||
|
||||
/* Creation of the demo accounts is now optional - the checkbox is on by default. */
|
||||
if ($create_demo)
|
||||
if ($HTTP_POST_VARS['create_demo'])
|
||||
{
|
||||
/* Create records for demo accounts */
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('demo', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
|
||||
$accountid = add_account('demo','Demo','Account','guest');
|
||||
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('demo2', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo2', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_account, acl_location, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_preferences (preference_owner, preference_value) VALUES ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('todo', 'run', ".$accountid.", 1)");
|
||||
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('demo3', 'u', '084e0343a0486ff05530df6c705c8bb4', 'Demo3', 'Account', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
|
||||
$accountid = add_account('demo2','Demo2','Account','guest');
|
||||
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_preferences (preference_owner, preference_value) VALUES ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_account, acl_location, acl_rights) VALUES ('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('todo', 'run', ".$accountid.", 1)");
|
||||
|
||||
$accountid = add_account('demo3','Demo3','Account','guest');
|
||||
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_preferences (preference_owner, preference_value) VALUES ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 'changepassword', ".$accountid.", 0)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('todo', 'run', ".$accountid.", 1)");
|
||||
}
|
||||
|
||||
/* Create records for administrator account */
|
||||
$sql = "insert into phpgw_accounts";
|
||||
$sql .= "(account_lid, account_type, account_pwd, account_firstname, account_lastname, account_lastpwd_change, account_status)";
|
||||
$sql .= "values ('$username', 'u', '".md5($passwd)."', '$fname', '$lname', ".time().", 'A')";
|
||||
$phpgw_setup->db->query($sql);
|
||||
$accountid = $phpgw_setup->db->get_last_insert_id('phpgw_accounts', 'account_id');
|
||||
$phpgw_setup->db->query("insert into phpgw_preferences (preference_owner, preference_value) values ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('phpgw_group', '".$admingroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights)values('preferences', 'changepassword', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('admin', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('nntp', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('todo', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("insert into phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) values('manual', 'run', ".$accountid.", 1)");
|
||||
$accountid = add_account($username,$fname,$lname,$passwd);
|
||||
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_preferences (preference_owner, preference_value) VALUES ('$accountid', '$defaultprefs')");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', '".$defaultgroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('phpgw_group', '".$admingroupid."', $accountid, 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('preferences', 'changepassword', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('admin', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('addressbook', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('filemanager', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('calendar', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('email', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('notes', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('nntp', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('todo', 'run', ".$accountid.", 1)");
|
||||
$phpgw_setup->db->query("INSERT INTO phpgw_acl (acl_appname, acl_location, acl_account, acl_rights) VALUES ('manual', 'run', ".$accountid.", 1)");
|
||||
|
||||
$phpgw_setup->db->query("update phpgw_accounts set account_expires='-1'",__LINE__,__FILE__);
|
||||
$phpgw_setup->db->transaction_commit();
|
||||
|
||||
Header("Location: index.php");
|
||||
Header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user