2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 04/11/2004 *
4 * =================== Last change: 10/29/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-admins.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Administrator management *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Admin-Accountsverwaltung *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2013 by Mailer Developer Team *
20 * For more information visit: http://mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
43 // Version of this extension
44 setThisExtensionVersion('0.7.9');
46 // Version history array (add more with , '0.0.1' and so on)
47 setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.2.0', '0.3.0', '0.3.1', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9'));
49 // Keep this extension always active!
50 setExtensionAlwaysActive('Y');
52 switch (getExtensionMode()) {
53 case 'setup': // Do stuff when installation is running
54 // SQL commands to run
55 addAdminMenuSql('admins', NULL, 'Admin-Management','Administratoren anlegen, löschen oder Passwort/E-Mail Adresse ändern.',1);
56 addAdminMenuSql('admins','admins_add','Admin hinzufügen','Neuen Admin-Account anlegen',0);
57 addAdminMenuSql('admins','admins_edit','Admin-Account ändern','Bestehende Admin-Accounts bearbeiten: E-Mail-Adresse, Passwort und/oder Login-Name ändern.',1);
60 case 'remove': // Do stuff when removing extension
61 // SQL commands to run
62 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'");
63 addDropTableSql('admins_acls');
64 addDropTableSql('admins_mails');
65 addExtensionDropTableColumnSql('admins', 'default_acl');
68 unregisterFilter(__FILE__, __LINE__, 'sql_admin_extra_data', 'ADD_EXTRA_SQL_DATA', TRUE, isExtensionDryRun());
69 unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'RESET_ADMINS_LOGIN_FAILURES', TRUE, isExtensionDryRun());
70 unregisterFilter(__FILE__, __LINE__, 'do_admin_login_pass', 'COUNT_ADMINS_LOGIN_FAILURE', TRUE, isExtensionDryRun());
71 unregisterFilter(__FILE__, __LINE__, 'do_admin_login_done', 'REHASH_ADMINS_PASSWORD', TRUE, isExtensionDryRun());
74 case 'activate': // Do stuff when admin activates this extension
75 // SQL commands to run
79 case 'deactivate': // Do stuff when admin deactivates this extension
80 // SQL commands to run
84 case 'update': // Update an extension
87 case 'modify': // When the extension got modified
90 case 'test': // For testing purposes
93 case 'init': // Do stuff when extension is initialized
96 default: // Unknown extension mode
97 reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName()));