************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
-{
+if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Create database
$SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_holidays";
$SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_holidays (
-id bigint(20) not null auto_increment,
-userid bigint(20) not null default '0',
-holiday_start varchar(10) not null default '0',
-holiday_end varchar(10) not null default '0',
-comments longblob not null,
+id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+holiday_start VARCHAR(10) NOT NULL DEFAULT '0',
+holiday_end VARCHAR(10) NOT NULL DEFAULT '0',
+comments LONGBLOB NOT NULL,
KEY (userid),
PRIMARY KEY(id)
) TYPE=MyISAM";
// Add default values to config
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_max bigint(20) not null default '30'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'";
// Add member menu
$SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort, visible, locked) VALUES ('main', 'holiday', 'Urlaubsschaltung', '4', 'Y', 'Y')";
case "0.0.6": // SQL queries for v0.0.6
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> überflüssige HTML-Tags entfernt.";
+ $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> überflüssige HTML-Tags entfernt.";
break;
case "0.0.7": // SQL queries for v0.0.7
break;
case "0.1.3": // SQL queries for v0.1.3
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_active enum('Y', 'N') not null default 'N'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_active ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
$SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_lock bigint(20) not null default '".(60*60*24*2)."'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_lock BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*60*24*2)."'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Die Mitglieder-Accounts werden nicht mehr gesperrt, sondern nur auf <STRONG>Urlaub</STRONG> geschaltet. Lassen Sie sich nicht davon verwirren, dass sie "freigegeben" sind!";
break;
case "0.1.4": // SQL queries for v0.1.4
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode enum('DIRECT', 'RESET') not null default 'RESET'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode ENUM('DIRECT', 'RESET') NOT NULL DEFAULT 'RESET'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Urlaubsschaltung wird erst Abends um 00:00 Uhr aktiv und nicht durch die Beantragung. Dies kann nun auch auf direkte Umstellung eingestellt werden.";
break;
case "0.1.5": // SQL queries for v0.1.5
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode enum('DIRECT', 'RESET') not null default 'RESET'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_mode ENUM('DIRECT', 'RESET') NOT NULL DEFAULT 'RESET'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle.";
break;
case "0.1.6": // SQL queries for v0.1.6
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_activated bigint(20) not null default '0'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD holiday_activated BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
// Update notes (these will be set as task text!)
$UPDATE_NOTES = "Fehlende Tabellenspalte hinzugefügt.";
break;
default: // Do stuff when extension is loaded
- $dummy = LOAD_CONFIG();
- $_CONFIG = array_merge($_CONFIG, $dummy);
- unset($dummy);
-
- // Do we have a daily-reset-run?
- if (((defined('__DAILY_RESET')) && ($_CONFIG['holiday_mode'] == "RESET")) || ($_CONFIG['holiday_mode'] == "DIRECT"))
- {
- // Ok, let's check for finished holidays and unlock those accounts
- $INC_POOL[] = PATH."inc/reset/reset_holiday.php";
- }
break;
}