[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: setup setup_demo.php,1.30.2.4,1.30.2.5
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: setup setup_demo.php,1.30.2.4,1.30.2.5 |
Date: |
Sun, 18 May 2003 18:07:58 -0400 |
Update of /cvsroot/phpgroupware/setup
In directory subversions:/tmp/cvs-serv13651
Modified Files:
Tag: Version-0_9_16-branch
setup_demo.php
Log Message:
updated to use new prefs format
Index: setup_demo.php
===================================================================
RCS file: /cvsroot/phpgroupware/setup/setup_demo.php,v
retrieving revision 1.30.2.4
retrieving revision 1.30.2.5
diff -C2 -r1.30.2.4 -r1.30.2.5
*** setup_demo.php 5 May 2003 04:28:38 -0000 1.30.2.4
--- setup_demo.php 18 May 2003 22:07:55 -0000 1.30.2.5
***************
*** 145,152 ****
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_acl');
- $defaultprefs['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";s:0:"";s:10:"dateformat";s:5:"m/d/Y";s:10:"timeformat";s:2:"12";s:4:"lang";s:2:"en";s:11:"default_app";s:0:"";s:8:"currency";s:1:"$";}';
- $defaultprefs['addressbook'] = 'a:1:{s:0:"";s:4:"True";}';
- $defaultprefs['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";}';
-
/* Create the demo groups */
$defaultgroupid =
add_account('Default','Default','Group',$passwd,'g');
--- 145,148 ----
***************
*** 161,198 ****
$GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('todo','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('manual','run'," . $defaultgroupid . ", 1)");
- $accountid[0] = add_account($username,$fname,$lname,$passwd);
/* Creation of the demo accounts is optional - the checkbox is
on by default. */
if(get_var('create_demo',Array('POST')))
{
! /* Create demo accounts */
! $accountid[1] =
add_account('demo','Demo','Account','guest');
! $accountid[2] =
add_account('demo2','Demo2','Account','guest');
! $accountid[3] =
add_account('demo3','Demo3','Account','guest');
}
- for ($i = 0; $i < count($accountid); $i++)
- {
- /* User permissions based on group membership with
additional user perms for the messenger and infolog apps */
- foreach($defaultprefs as $app => $vals)
- {
- $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_preferences(preference_owner,preference_app, preference_value) VALUES(" .
$accountid[$i] .", '$app', '$vals')", __LINE__, __FILE__);
- }
- $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group',$defaultgroupid," . $accountid[$i] . ", 1)");
- $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','changepassword', " . $accountid[$i] . ",0)",__LINE__,
__FILE__);
- $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('messenger','run'," . $accountid[$i] . ", 1)",__LINE__, __FILE__);
- $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('infolog','run'," . $accountid[$i] . ", 1)",__LINE__, __FILE__);
- }
! /* Add extra values for administrator account */
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group',$admingroupid," . $accountid[0] . ",1)",__LINE__,
__FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('admin','run',$admingroupid, 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('addressbook','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('filemanager','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('calendar','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('email','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('notes','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('nntp','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('todo','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('manual','run'," . $accountid[0] . ", 1)",__LINE__, __FILE__);
$GLOBALS['phpgw_setup']->db->transaction_commit();
--- 157,220 ----
$GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('todo','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('manual','run'," . $defaultgroupid . ", 1)");
+ $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','run'," . $defaultgroupid . ", 1)");
+
+ function insert_default_prefs($accountid)
+ {
+ $defaultprefs =
unserialize('a:3:{s:6:"common";a:10:{s:9:"maxmatchs";s:2:"15";s:12:"template_set";s:8:"verdilak";s:5:"theme";s:9:"submarine";s:13:"navbar_format";s:5:"icons";s:9:"tz_offset";s:0:"";s:10:"dateformat";s:5:"Y/m/d";s:10:"timeformat";s:2:"24";s:4:"lang";s:2:"en";s:11:"default_app";s:0:"";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:"9";s:11:"workdayends";s:2:"17";s:13:"weekdaystarts";s:6:"Monday";s:15:"defaultcalendar";s:9:"month.php";}}');
+ $defaultprefs['common']['show_help'] = '1';
+ $defaultprefs['calendar']['planner_start_with_group'] =
$defaultgroupid;
+
+ foreach ($defaultprefs as $app => $prefs)
+ {
+ $prefs = addslashes(serialize($prefs));
+ $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_preferences(preference_owner,preference_app,preference_value)
VALUES($accountid,'$app','$prefs')",__FILE__,__LINE__);
+ }
+ }
+ insert_default_prefs(-2); // set some default prefs
/* Creation of the demo accounts is optional - the checkbox is
on by default. */
if(get_var('create_demo',Array('POST')))
{
! /* Create records for demo accounts */
! $accountid =
add_account('demo','Demo','Account','guest');
!
! /* User permissions based on group membership with
additional user perms for the messenger and infolog apps */
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','changepassword', " . $accountid . ",0)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group', '" . $defaultgroupid."'," . $accountid . ",1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('messenger','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('infolog','run'," . $accountid . ", 1)");
!
! $accountid =
add_account('demo2','Demo2','Account','guest');
!
! /* User permissions based solely on group membership */
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','changepassword', ".$accountid.", 0)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group','" . $defaultgroupid . "'," . $accountid . ",1)");
!
! $accountid =
add_account('demo3','Demo3','Account','guest');
!
! /* User-specific perms, no group membership */
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','changepassword', " . $accountid . ",0)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('addressbook','run', " . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('calendar','run', " . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('notes','run', " . $accountid . ", 1)");
! $GLOBALS['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 */
! $accountid = add_account($username,$fname,$lname,$passwd);
!
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group','" . $defaultgroupid."'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('phpgw_group','" . $admingroupid."'," . $accountid . ",1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('preferences','changepassword', " . $accountid . ",1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('admin','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('addressbook','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('filemanager','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('calendar','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('email','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('notes','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('nntp','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('todo','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('manual','run'," . $accountid . ", 1)");
! $GLOBALS['phpgw_setup']->db->query("INSERT INTO
phpgw_acl(acl_appname,acl_location,acl_account,acl_rights)
VALUES('infolog','run'," . $accountid . ", 1)");
$GLOBALS['phpgw_setup']->db->transaction_commit();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: setup setup_demo.php,1.30.2.4,1.30.2.5,
Ralf Becker <address@hidden> <=