made the deletion of all user, group and ACL data by setup_demo.php mandatory (default off) so that other install-scripts can add users, groups or ACL records

This commit is contained in:
Ralf Becker 2003-12-29 21:12:37 +00:00
parent 65034dab5a
commit e5af8693af
6 changed files with 55 additions and 149 deletions

View File

@ -158,6 +158,10 @@
{
echo '<br>' . $setup_info[$appname]['title'] . ' ' . lang('Historylog removed') . '.';
}
// delete all application categories and ACL
$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_categories WHERE cat_appname='$appname'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_acl WHERE acl_appname='$appname'",__LINE__,__FILE__);
}
}
@ -237,8 +241,8 @@
$GLOBALS['phpgw_setup']->html->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')');
}
$detail = get_var('detail',Array('GET'));
$resolve = get_var('resolve',Array('GET'));
$detail = get_var('detail',Array('GET'));
$resolve = get_var('resolve',Array('GET'));
if(@$detail)
{
@ksort($setup_info[$detail]);
@ -248,13 +252,13 @@
$setup_tpl->set_var('name','application');
$setup_tpl->set_var('details', lang($setup_info[$detail]['title']));
$setup_tpl->pparse('out','detail');
foreach($setup_info[$detail] as $key => $val)
{
if($key != 'title')
{
$i = ($i ? 0 : 1);
if ($key == 'tables')
{
@ -400,7 +404,7 @@
{
if(@$value['name'])
{
$i = ($i ? 0 : 1);
$i = ($i ? 0 : 1);
$setup_tpl->set_var('apptitle',$value['title']?$value['title']:lang($value['name']));
$setup_tpl->set_var('currentver',@$value['currentver']);
$setup_tpl->set_var('version',$value['version']);

View File

@ -351,8 +351,7 @@
'<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)')
'<b>'.lang('to setup 1 admin account and 3 demo accounts.').'</b>'
);
}
else
@ -367,7 +366,7 @@
'<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>')
'<b>'.lang('to setup 1 admin account and 3 demo accounts.').'</b>'
);
}
$config_td = "$btn_edit_config" ."$link_make_accts";
@ -420,7 +419,7 @@
'submit',lang('Manage Languages'),
'');
// show system-charset and offer conversation
include(PHPGW_API_INC.'/class.translation_sql.inc.php');
include_once(PHPGW_API_INC.'/class.translation_sql.inc.php');
$translation = new translation;
$btn_manage_lang .= lang('Current system-charset is %1, click %2here%3 to change it.',
$translation->system_charset ? "'$translation->system_charset'" : lang('not set'),

View File

@ -1,7 +1,7 @@
(account deletion in sql only) setup de (Benutzerkontenlöschung NUR in SQL)
00 (disable) setup de 00 (abgeschaltet / empfohlen)
13 (ntp) setup de 13 (ntp)
80 (http) setup de 80 (http)
<b>this will create 1 admin account and 3 demo accounts</b><br>the username/passwords are: demo/guest, demo2/guest and demo3/guest. setup de <b>Dies wird 1 Admin- und 3 Demo Benutzerkonten anlegen.</b><br>Die Benutzernamen/Passworte sind: demo/guest, demo2/guest and demo3/guest.
actions setup de Aktionen
add a domain setup de Eine Domain zufügen
add auto-created users to this group ('default' will be attempted if this is empty.) setup de Automatisch erzeugte Benutzer zu dieser Grupper zufügen ('Default' wird versucht wenn nichts angegeben.)
@ -90,12 +90,14 @@ datetime port.<br>if using port 13, please set firewall rules appropriately befo
db host setup de Datenbank Host
db name setup de Datenbank Name
db password setup de Datenbank Passwort
db port setup de Datenbank Port
db root password setup de Datenbank Root Passwort
db root username setup de Datenbank Root Benutzername
db type setup de Datenbank Type
db user setup de Datenbank Benutzer
default file system space per user/group ? setup de Vorgabewert Festplatenplatz pro Benutzer / Gruppe ?
delete setup de Löschen
delete all existing sql accounts, groups, acls and preferences (normaly not necessary)? setup de Alle existierende SQL Benutzer, Gruppen, ACLs und Einstellungen löschen (normal nicht nötig)?
delete all my tables and data setup de Alle meine Tabellen und Daten löschen
delete all old languages and install new ones setup de Alle installierten Sprachen löschen und neu installieren
deleting tables setup de Lösche Tabellen
@ -116,6 +118,7 @@ download setup de Herunterladen
edit current configuration setup de Gegenwärtige Konfiguration überarbeiten
edit your existing header.inc.php setup de Bearbeiten ihrer existierenden header.inc.php
edit your header.inc.php setup de Bearbeiten ihrer header.inc.php
egroupware administration manual setup de eGroupWare Adminsitrationsmanual (nur in englisch)
enable for extra debug-messages setup de ankreutzen für zusätzliche Diagnosemeldungen
enable ldap version 3 setup de LDAP Version 3 verwenden
enable mcrypt setup de MCrypt einschalten
@ -133,8 +136,8 @@ enter your http proxy server setup de HTTP Proxy Server
enter your http proxy server password setup de Passwort des HTTP Proxy Server
enter your http proxy server port setup de Port des HTTP Proxy Server
enter your http proxy server username setup de Benutzername des HTTP Proxy Server
export has been completed! you will need to set the user passwords manually. setup de Export ist abgeschlossen! Sie müssen die Benutzerpasswörter manuell setzen.
export egroupware accounts from sql to ldap setup de eGroupWare Benutzerkonten von SQL nach LDAP exportieren
export has been completed! you will need to set the user passwords manually. setup de Export ist abgeschlossen! Sie müssen die Benutzerpasswörter manuell setzen.
export sql users to ldap setup de SQL-Benutzer in LDAP exportieren
file setup de DATEI
file type, size, version, etc. setup de Datei Typ, Größe, Version, usw.
@ -218,7 +221,7 @@ no microsoft sql server support found. disabling setup de Keine Unterst
no modes available setup de kein Modus verfügbar
no mysql support found. disabling setup de Keine Unterstützung für MySQL gefunden. Abgeschaltet
no oracle-db support found. disabling setup de Keine Unterstützung für Oracle gefunden. Abgeschaltet
no postgres-db support found. disabling setup de Keine Unterstützung für Postgres gefunden. Abgeschaltet
no postgresql support found. disabling setup de Keine Unterstützung für PostgreSQL gefunden. Abgeschaltet
no xml support found. disabling setup de Keine Unterstützung für XML gefunden. Abgeschaltet
not all mcrypt algorithms and modes work with egroupware. if you experience problems try switching it off. setup de Nicht alle mcrypt Algorithmen und Modi funktionieren mit eGroupWare. Wenn sie Probleme feststellen, versuchen sie es abzuschalten.
not complete setup de nicht komplett
@ -242,7 +245,6 @@ passwords did not match, please re-enter setup de Passworte stimmten nicht
path information setup de Pfadinformationen
path to user and group files has to be outside of the webservers document-root!!! setup de Pfad zu Benutzer und Gruppen Dateien MUSS AUSSERHALB des Wurzelverzeichnisses (Document-root) des Webservers sein!!!
persistent connections setup de Permanennte Verbindungen
egroupware administration manual setup de eGroupWare Adminsitrationsmanual (nur in englisch)
please check for sql scripts within the application's directory setup de Bitte schauen Sie nach sql-Scripten im Applikations-Ordner
please check read/write permissions on directories, or back up and use another option. setup de Bitte überprüfen sie die lese/schreib Rechte der Verzeichnisse oder gehen sie zurück und benutzen eine andere Option.
please configure egroupware for your environment setup de Bitte konfigurieren Sie eGroupWare für Ihre Umgebung
@ -317,6 +319,7 @@ tables dropped setup de Tabellen wurden gel
tables installed, unless there are errors printed above setup de Tabellen wurden installiert, au&szlig; oben sind Fehlermelungen zu sehen
tables upgraded setup de Tabellen wurden aktualisiert
target version setup de Ziel Version
tcp port number of database server setup de TCP Port des Datenbank Servers
text entry setup de Texteingabe
the db_type in defaults (%1) is not supported on this server. using first supported type. setup de Der Datenbanktyp in den Vorgaben (%1) wird von diesem Server nicht unterstützt, verwende ersten unterstützten Typ.
the file setup de der Datei
@ -333,9 +336,8 @@ this section will help you import users and groups from your ldap tree into egro
this section will help you setup your ldap accounts for use with egroupware setup de Dieser Abschnitt wird ihnen helfen ihrer LDAP Benutzer für eGroupWare vorzubereiten.
this should be around 30 bytes in length.<br>note: the default has been randomly generated. setup de Das sollte ungefähr 30 Zeichen lang sein<br>Hinweis: Die Vorgabe wurde zufällig erzeugt.
this stage is completed<br> setup de Dieser Schritt ist abgeschlossen<br>
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 de Dies wird 1 Admin- und 3 Demo Benutzerkonten erstellen<br>Die Benutzernamen/Passworte sind: demo/guest, demo2/guest and demo3/guest.<br><b>!!!DIES WIRD ALLE EXISTIERENDEN BENUTZERKONTEN LÖSCHEN!!!</b><br>
to a version it does not know about setup de auf eine Version von der nichts bekannt ist
to setup 1 admin account and 3 demo accounts.<br><b>this will delete all existing accounts</b> setup de zum Einrichten von eines Adminkontos und ggf. 3 Demo-Benutzerkonten.<br><b>Dies wird alle existierenden Benutzerkonten löschen!</b>
to setup 1 admin account and 3 demo accounts. setup de zum Anlegen von eines Administratorkontos und ggf. 3 Demo-Benutzerkonten.
top setup de oben
translations added setup de Übersetzungen hinzugefügt
translations removed setup de Übersetzungen entfernt
@ -375,7 +377,7 @@ you appear to have microsoft sql server support enabled setup de Sie scheinen Mi
you appear to have mysql support enabled setup de Sie scheinen MySQL Unterstützung zu haben.
you appear to have oracle support enabled setup de Sie scheinen Oracle Unterstützung zu haben.
you appear to have oracle v8 (oci) support enabled setup de Sie scheinen Oracle V8 (OCI) Unterstützung zu haben.
You appear to have PostgreSQL support enabled setup de Sie scheinen Postgres Unterstützung zu haben.
you appear to have postgresql support enabled setup de Sie scheinen PostgreSQL Unterstützung zu haben.
you appear to have xml support enabled setup de Sie scheinen XML Unterstützung zu haben.
you are ready for this stage, but this stage is not yet written.<br> setup de Sie sind bereit für diesen Schritt, aber dieser Abschnitt wurde noch nicht geschrieben.<br>
you didn't enter a config password for domain %1 setup de Sie haben kein Passwort für die Domain %1 angegeben

View File

@ -1,7 +1,7 @@
(account deletion in sql only) setup en (account deletion in SQL Only)
00 (disable) setup en 00 (disable / recomended)
13 (ntp) setup en 13 (ntp)
80 (http) setup en 80 (http)
<b>this will create 1 admin account and 3 demo accounts</b><br>the username/passwords are: demo/guest, demo2/guest and demo3/guest. setup en <b>This will create 1 admin account and 3 demo accounts</b><br>The username/passwords are: demo/guest, demo2/guest and demo3/guest.
actions setup en Actions
add a domain setup en Add a domain
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.)
@ -95,6 +95,7 @@ db type setup en DB Type
db user setup en DB User
default file system space per user/group ? setup en Default file system space per user/group ?
delete setup en Delete
delete all existing sql accounts, groups, acls and preferences (normaly not necessary)? setup en Delete all existing SQL accounts, groups, ACLs and preferences (normaly not necessary)?
delete all my tables and data setup en Delete all my tables and data
delete all old languages and install new ones setup en Delete all old languages and install new ones
deleting tables setup en Deleting Tables
@ -115,6 +116,7 @@ download setup en Download
edit current configuration setup en Edit Current Configuration
edit your existing header.inc.php setup en Edit your existing header.inc.php
edit your header.inc.php setup en Edit your header.inc.php
egroupware administration manual setup en eGroupWare Administration Manual
enable for extra debug-messages setup en enable for extra debug-messages
enable ldap version 3 setup en Enable LDAP Version 3
enable mcrypt setup en Enable MCrypt
@ -132,8 +134,8 @@ enter your http proxy server setup en Enter your HTTP proxy server
enter your http proxy server password setup en Enter your HTTP proxy server password
enter your http proxy server port setup en Enter your HTTP proxy server port
enter your http proxy server username setup en Enter your HTTP proxy server username
export has been completed! you will need to set the user passwords manually. setup en Export has been completed! You will need to set the user passwords manually.
export egroupware accounts from sql to ldap setup en Export eGroupWare accounts from SQL to LDAP
export has been completed! you will need to set the user passwords manually. setup en Export has been completed! You will need to set the user passwords manually.
export sql users to ldap setup en Export SQL users to LDAP
file setup en FILE
file type, size, version, etc. setup en file type, size, version, etc.
@ -217,7 +219,7 @@ no microsoft sql server support found. disabling setup en No Microsoft SQL Serve
no modes available setup en no modes available
no mysql support found. disabling setup en No MySQL support found. Disabling
no oracle-db support found. disabling setup en No Oracle-DB support found. Disabling
no postgres-db support found. disabling setup en No Postgres-DB support found. Disabling
no postgresql support found. disabling setup en No PostgreSQL support found. Disabling
no xml support found. disabling setup en No XML support found. Disabling
not all mcrypt algorithms and modes work with egroupware. if you experience problems try switching it off. setup en Not all mcrypt algorithms and modes work with eGroupWare. If you experience problems try switching it off.
not complete setup en not complete
@ -241,7 +243,6 @@ passwords did not match, please re-enter setup en Passwords did not match, pleas
path information setup en Path information
path to user and group files has to be outside of the webservers document-root!!! setup en Path to user and group files HAS TO BE OUTSIDE of the webservers document-root!!!
persistent connections setup en Persistent connections
egroupware administration manual setup en eGroupWare Administration Manual
please check for sql scripts within the application's directory setup en Please check for sql scripts within the application's directory
please check read/write permissions on directories, or back up and use another option. setup en Please check read/write permissions on directories, or back up and use another option.
please configure egroupware for your environment setup en Please configure eGroupWare for your environment
@ -316,7 +317,7 @@ tables dropped setup en tables dropped
tables installed, unless there are errors printed above setup en tables installed, unless there are errors printed above
tables upgraded setup en tables upgraded
target version setup en Target Version
TCP port number of database server setup en TCP port number of database server
tcp port number of database server setup en TCP port number of database server
text entry setup en Text Entry
the db_type in defaults (%1) is not supported on this server. using first supported type. setup en The db_type in defaults (%1) is not supported on this server. using first supported type.
the file setup en the file
@ -332,9 +333,8 @@ this section will help you import users and groups from your ldap tree into egro
this section will help you setup your ldap accounts for use with egroupware setup en This section will help you setup your LDAP accounts for use with eGroupWare
this should be around 30 bytes in length.<br>note: the default has been randomly generated. setup en This should be around 30 bytes in length.<br>Note: The default has been randomly generated.
this stage is completed<br> setup en This stage is completed<br>
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 en 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>
to a version it does not know about setup en to a version it does not know about
to setup 1 admin account and 3 demo accounts.<br><b>this will delete all existing accounts</b> setup en to setup 1 admin account and 3 demo accounts.<br><b>This will delete all existing accounts</b>
to setup 1 admin account and 3 demo accounts. setup en to setup 1 admin account and 3 demo accounts.
top setup en top
translations added setup en Translations Added
translations removed setup en Translations Removed
@ -374,7 +374,7 @@ you appear to have microsoft sql server support enabled setup en You appear to h
you appear to have mysql support enabled setup en You appear to have MySQL support enabled
you appear to have oracle support enabled setup en You appear to have Oracle support enabled
you appear to have oracle v8 (oci) support enabled setup en You appear to have Oracle V8 (OCI) support enabled
you appear to have postgres-db support enabled setup en You appear to have Postgres-DB support enabled
you appear to have postgresql support enabled setup en You appear to have PostgreSQL support enabled
you appear to have xml support enabled setup en You appear to have XML support enabled
you are ready for this stage, but this stage is not yet written.<br> setup en You are ready for this stage, but this stage is not yet written.<br>
you didn't enter a config password for domain %1 setup en You didn't enter a config password for domain %1

View File

@ -29,40 +29,6 @@
exit;
}
function add_account($username,$first,$last,$passwd,$type='u')
{
if($type == 'u')
{
$account_info = array(
'account_type' => $type,
'account_lid' => $username,
'account_passwd' => $passwd,
'account_firstname' => $first,
'account_lastname' => $last,
'account_status' => 'A',
'account_primary_group' => $GLOBALS['phpgw']->accounts->name2id('default'),
'account_groups' => array($GLOBALS['phpgw']->accounts->name2id('default')),
'account_expires' => -1
);
}
else
{
$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 (int)$GLOBALS['phpgw']->accounts->name2id($username);
}
if(!get_var('submit',Array('POST')))
{
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
@ -81,9 +47,9 @@
$GLOBALS['phpgw_setup']->html->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>')
. ' '. lang('(account deletion in SQL only)'
));
$setup_tpl->set_var('description',lang('<b>This will create 1 admin account and 3 demo accounts</b><br>The username/passwords are: demo/guest, demo2/guest and demo3/guest.'));
$setup_tpl->set_var('lang_deleteall',lang('Delete all existing SQL accounts, groups, ACLs and preferences (normaly not necessary)?'));
$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'));
@ -118,68 +84,23 @@
}
$GLOBALS['phpgw_setup']->loaddb();
/* Load up some configured values */
$GLOBALS['phpgw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config ".
"WHERE config_name LIKE 'ldap%' OR config_name LIKE 'account_%'",__LINE__,__FILE__);
while ($GLOBALS['phpgw_setup']->db->next_record())
{
$config[$GLOBALS['phpgw_setup']->db->f('config_name')] = $GLOBALS['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'];
$GLOBALS['phpgw_info']['server']['ldap_version3'] = $config['ldap_version3'];
$GLOBALS['phpgw_info']['server']['account_min_id'] = $config['account_min_id'];
$GLOBALS['phpgw_info']['server']['account_max_id'] = $config['account_max_id'];
unset($config);
/* Create dummy class, then accounts object */
class phpgw
{
var $db;
var $common;
var $accounts;
}
$GLOBALS['phpgw'] = new phpgw;
copyobj($GLOBALS['phpgw_setup']->db,$GLOBALS['phpgw']->db);
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
$GLOBALS['phpgw']->accounts = CreateObject('phpgwapi.accounts');
$GLOBALS['phpgw']->translation = CreateObject('phpgwapi.translation');
if(($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap') &&
!$GLOBALS['phpgw']->accounts->ds)
{
printf("<b>Error: Error connecting to LDAP server %s!</b><br>",$GLOBALS['phpgw_info']['server']['ldap_host']);
exit;
}
/* Begin transaction for acl, etc */
$GLOBALS['phpgw_setup']->db->transaction_begin();
/* Now, clear out existing tables */
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_accounts');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_preferences');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_acl');
if ($_POST['delete_all'])
{
/* Now, clear out existing tables */
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_accounts');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_preferences');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_acl');
}
/* Create the demo groups */
$defaultgroupid = (int)add_account('Default','Default','Group',$passwd,'g');
$admingroupid = (int)add_account('Admins','Admin', 'Group',$passwd,'g');
$defaultgroupid = (int)$GLOBALS['phpgw_setup']->add_account('Default','Default','Group',False,False);
$admingroupid = (int)$GLOBALS['phpgw_setup']->add_account('Admins','Admin','Group',False,False);
/* Group perms for the default group */
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('addressbook','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('filemanager','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('calendar','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('email','run'," . $defaultgroupid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('notes','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)");
$GLOBALS['phpgw_setup']->add_acl(array('addressbook','calendar','infolog','email','preferences'),'run',$defaultgroupid);
$GLOBALS['phpgw_setup']->add_acl('admin','run',$admingroupid);
function insert_default_prefs($accountid)
{
@ -217,39 +138,15 @@
/* 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)");
$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)");
// Create 3 demo accounts
$accountid = $GLOBALS['phpgw_setup']->add_account('demo','Demo','Account','guest');
$accountid = $GLOBALS['phpgw_setup']->add_account('demo2','Demo2','Account','guest');
$accountid = $GLOBALS['phpgw_setup']->add_account('demo3','Demo3','Account','guest');
}
/* 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('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('infolog','run'," . $accountid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('headlines','run'," . $accountid . ", 1)");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('bookmarks','run'," . $accountid . ", 1)");
/* Create records for administrator account, with Admins as primary and Default as additional group */
$accountid = $GLOBALS['phpgw_setup']->add_account($username,$fname,$lname,$passwd,'Admins',True);
$GLOBALS['phpgw_setup']->add_acl('phpgw_group',$admingroupid,$accountid);
$GLOBALS['phpgw_setup']->db->transaction_commit();

View File

@ -1,7 +1,11 @@
<!-- BEGIN setup_demo -->
<table border="0" width="90%" cellspacing="0" cellpadding="2">
<tr>
<td>{description} <br/><br/> </td>
<td>
{description}
<p>
<input type="checkbox" name="delete_all">{lang_deleteall}
</td>
</tr>
<tr>
<td align="left" bgcolor="#cccccc">{detailadmin}</td>