From cb2128544395e21ccb5c9d4d626024e3ce08a878 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 4 Feb 2015 13:15:11 +0000 Subject: [PATCH] create anonymous user with random password when installing or updating to 14.2, as it is required to be able to share files --- phpgwapi/setup/default_records.inc.php | 7 +++++++ phpgwapi/setup/tables_update.inc.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/phpgwapi/setup/default_records.inc.php b/phpgwapi/setup/default_records.inc.php index 45e1e49f1f..394565b285 100644 --- a/phpgwapi/setup/default_records.inc.php +++ b/phpgwapi/setup/default_records.inc.php @@ -234,3 +234,10 @@ foreach(array('','addressbook', 'calendar', 'infolog', 'tracker', 'timesheet', ' } $prefs->save_repository(false, 'default'); egw_vfs::$is_root = false; + +/** + * Create anonymous user for sharing of files + */ +$GLOBALS['egw_setup']->add_account('NoGroup', 'No', 'Rights', false, false); +$anonymous = $GLOBALS['egw_setup']->add_account('anonymous', 'SiteMgr', 'User', 'anonymous', 'NoGroup'); +$GLOBALS['egw_setup']->add_acl('phpgwapi', 'anonymous', $anonymous); diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 9abeec373b..94b179344b 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -53,5 +53,10 @@ function phpgwapi_upgrade14_1() */ function phpgwapi_upgrade14_1_900() { + // Create anonymous user for sharing of files + $GLOBALS['egw_setup']->add_account('NoGroup', 'No', 'Rights', false, false); + $anonymous = $GLOBALS['egw_setup']->add_account('anonymous', 'SiteMgr', 'User', 'anonymous', 'NoGroup'); + $GLOBALS['egw_setup']->add_acl('phpgwapi', 'anonymous', $anonymous); + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '14.2'; } \ No newline at end of file