Ignore:
Timestamp:
Apr 6, 2015, 1:03:33 PM (10 years ago)
Author:
chronos
Message:
  • Added: Support for Internet free access. Unregistered users are redirected to activation page where they can found useful information and activate free access for 24 hours.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Setup/Updates.php

    r734 r735  
    13061306  $Manager->Execute('ALTER TABLE `ModuleLink`
    13071307        MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;');
     1308}
     1309
     1310function UpdateTo735($Manager)
     1311{
     1312        $Manager->Execute('CREATE TABLE IF NOT EXISTS `NetworkFreeAccess` (
     1313`Id` int(11) NOT NULL,
     1314`IPAddress` varchar(255) NOT NULL,
     1315`Time` datetime NOT NULL
     1316) ENGINE=InnoDB DEFAULT CHARSET=utf8;');
     1317       
     1318        $Manager->Execute('ALTER TABLE `NetworkFreeAccess`
     1319        ADD PRIMARY KEY (`Id`);');
     1320       
     1321        $Manager->Execute('ALTER TABLE `NetworkFreeAccess`
     1322        MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;');
     1323       
     1324        $Manager->Execute('ALTER TABLE `NetworkFreeAccess` ADD `Configured` INT NOT NULL ;');
     1325        $DbResult = $Manager->Execute('INSERT INTO `SchedulerAction` (`Id`, `Name`, `Class`) VALUES '.
     1326                '(NULL, "Konfigurace internetu zdarma", "ScheduleConfigureFreeAccess");');
     1327        $ActionId = $Manager->Database->insert_id;
     1328        $Manager->Execute('INSERT INTO `Scheduler` (`Id`, `Name`, `Enabled`, `Action`,
     1329                `Log`, `LastExecutedTime`, `ScheduledTime`, `Period`) VALUES (NULL, "Internet zdarma",
     1330                1, '.$ActionId.', "", NULL, "", 5);');
     1331        $Manager->Execute('ALTER TABLE `Scheduler` CHANGE `ScheduledTime` `ScheduledTime` DATETIME NULL;');
    13081332}
    13091333
     
    13721396        729 => array('Revision' => 730, 'Function' => 'UpdateTo730'),
    13731397        730 => array('Revision' => 731, 'Function' => 'UpdateTo731'),
     1398        731 => array('Revision' => 735, 'Function' => 'UpdateTo735'),
    13741399    ));
    13751400  }
Note: See TracChangeset for help on using the changeset viewer.