Changeset 693
- Timestamp:
- Sep 14, 2014, 8:26:20 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r692 r693 2 2 3 3 $Revision = 692; // Subversion revision 4 $DatabaseRevision = 6 88; // SQL structure revision5 $ReleaseTime = strtotime('2014-09-1 1');4 $DatabaseRevision = 692; // SQL structure revision 5 $ReleaseTime = strtotime('2014-09-14'); -
trunk/Common/Setup/Updates.php
r689 r693 899 899 } 900 900 901 function UpdateTo692($Manager) 902 { 903 // Convert user emails to contacts 904 $DbResult = $Manager->Execute('SELECT `Id` FROM `ContactCategory` WHERE `Name` = "Telefón"'); 905 $DbRow = $DbResult->fetch_assoc(); 906 $ContactCategoryId = $DbRow['Id']; 907 908 $Manager->Execute('INSERT INTO `Contact` (SELECT NULL AS `Id`, '.$ContactCategoryId.' AS `Category`, '. 909 '`PhoneNumber` AS `Value`, NULL AS `Subject`, `Id` AS `User`, "" AS `Descriptions`, 1 AS `Receive` FROM `User` 910 WHERE (`PhoneNumber` != "") AND (`PhoneNumber` != 0))'); 911 $Manager->Execute('ALTER TABLE `User` DROP `PhoneNumber`;'); 912 } 913 901 914 class Updates 902 915 { … … 948 961 678 => array('Revision' => 679, 'Function' => 'UpdateTo679'), 949 962 679 => array('Revision' => 688, 'Function' => 'UpdateTo688'), 963 688 => array('Revision' => 692, 'Function' => 'UpdateTo692'), 950 964 )); 951 965 } -
trunk/Common/VCL/General.php
r666 r693 1 1 <?php 2 2 3 session_start();4 3 5 4 //print_r($_SESSION); -
trunk/Modules/NetworkConfigRouterOS/RouterboardAPI.php
r685 r693 56 56 $this->Write('/login'); 57 57 $Response = $this->Read(false); 58 if ((count($Response) > 0) and ($Response[0] == '!done')) {58 if ((count($Response) > 1) and ($Response[0] == '!done')) { 59 59 if (preg_match_all('/[^=]+/i', $Response[1], $Matches)) { 60 60 if ($Matches[0][0] == 'ret' && strlen($Matches[0][1]) == 32) { -
trunk/Modules/User/User.php
r668 r693 127 127 } 128 128 129 function Register($Login, $Password, $Password2, $Email, $Name , $PhoneNumber, $ICQ)129 function Register($Login, $Password, $Password2, $Email, $Name) 130 130 { 131 131 if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '') || ($Name == '')) $Result = DATA_MISSING; … … 151 151 'Password' => $PasswordHash->Hash($Password, $Salt), 'Salt' => $Salt, 152 152 'Email' => $Email, 'RegistrationTime' => 'NOW()', 153 'Locked' => 1 , 'PhoneNumber' => $PhoneNumber, 'ICQ' => $ICQ));153 'Locked' => 1)); 154 154 $UserId = $this->Database->insert_id; 155 155 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, … … 460 460 `RegistrationTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 461 461 `Locked` tinyint(1) NOT NULL DEFAULT '0', 462 `ICQ` int(11) NOT NULL DEFAULT '0',463 `PhoneNumber` varchar(32) NOT NULL DEFAULT '',464 462 `InitPassword` varchar(255) NOT NULL, 465 463 PRIMARY KEY (`Id`), … … 571 569 'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 572 570 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 573 'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),574 571 ), 575 572 )); … … 584 581 'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 585 582 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 586 'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),587 'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''),588 583 ), 589 584 )); … … 619 614 'RegistrationTime' => array('Type' => 'DateTime', 'Caption' => 'Čas registrace', 'Default' => ''), 620 615 'Locked' => array('Type' => 'Boolean', 'Caption' => 'Uzamčen', 'Default' => ''), 621 'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefon', 'Default' => ''),622 616 'UserRel' => array('Type' => 'TUserCustomerRelListUser', 'Caption' => 'Přístup k zákazníkům', 'Default' => ''), 623 617 'Permission' => array('Type' => 'TPermissionUserAssignmentListUser', 'Caption' => 'Oprávnění', 'Default' => ''), -
trunk/Modules/User/UserList.php
r672 r693 19 19 array('Name' => 'Name', 'Title' => 'Jméno'), 20 20 array('Name' => 'Email', 'Title' => 'E-mail'), 21 array('Name' => 'PhoneNumber', 'Title' => 'Telefón'),22 21 array('Name' => '', 'Title' => 'Počítače'), 23 22 ); … … 30 29 while($User = $DbResult->fetch_assoc()) 31 30 { 32 if($User['PhoneNumber'] > 0) $User['PhoneNumber'] = $User['PhoneNumber'];33 else $User['PhoneNumber'] = ' ';34 35 31 $Devices = array(); 36 32 $DbResult2 = $this->Database->query('SELECT `Id` FROM `Member` WHERE `Member`.`ResponsibleUser` = '.$User['Id']); … … 48 44 $Output .= '<tr><td>'.$User['Name'].'</td>'. 49 45 '<td>'.$User['Email'].'</td>'. 50 '<td>'.$User['PhoneNumber'].'</td>'.51 46 '<td>'.$User['Devices'].'</td></tr>'; 52 47 } -
trunk/Modules/User/UserPage.php
r634 r693 9 9 function Panel($Title, $Content, $Menu = array()) 10 10 { 11 if(count($Menu) > 0) 11 if(count($Menu) > 0) 12 12 foreach($Menu as $Item) 13 13 $Title .= '<div class="Action">'.$Item.'</div>'; … … 19 19 $Output = ''; 20 20 if($this->System->User->User['Id'] != null) 21 { 21 { 22 22 $Actions = ''; 23 23 foreach($this->System->ModuleManager->Modules['User']->UserPanel as $Action) … … 32 32 $Output .= $this->Panel('Nabídka uživatele', $Actions); 33 33 $Output .= '</td><td>'; 34 if($this->System->User->User['Id'] != null) 35 { 36 $Form = new Form($this->System->FormManager); 37 $Form->SetClass('UserOptions'); 38 $Form->LoadValuesFromDatabase($this->System->User->User['Id']); 39 $Form->OnSubmit = '?Action=UserOptionsSave'; 40 $Output .= $Form->ShowViewForm(); 41 } else $Output .= $this->SystemMessage('Nastavení uživatele', 'Nejste přihlášen'); 42 34 43 //$Output .= $this->Panel('Přehled', $this->UserPanel()); 35 44 $Output .= '</td></tr></table></div>'; … … 61 70 $Form->OnSubmit = '?Action=Login'; 62 71 if(array_key_exists('StayLogged', $_POST) and ($_POST['StayLogged'] == 'on')) $StayLogged = true; 63 else $StayLogged = false; 72 else $StayLogged = false; 64 73 $Result = $this->System->User->Login($_POST['Username'], $_POST['Password'], $StayLogged); 65 74 $Output .= $this->SystemMessage('Přihlášení', $Result); … … 77 86 } 78 87 } else $Output .= $this->SystemMessage('Přihlášení', 'Nezadány přihlašovací údaje'); 79 } else 88 } else 80 89 if($Action == 'Logout') 81 90 { … … 86 95 } else 87 96 if($Action == 'UserOptions') 88 { 97 { 89 98 if($this->System->User->User['Id'] != null) 90 99 { … … 118 127 if($Action == 'UserRegisterConfirm') 119 128 { 120 $Output .= $this->SystemMessage('Potvrzení registrace', 129 $Output .= $this->SystemMessage('Potvrzení registrace', 121 130 $this->System->User->RegisterConfirm($_GET['User'], $_GET['H'])); 122 131 } else … … 138 147 { 139 148 $Output .= $Form->ShowEditForm(); 140 } 149 } 141 150 } else 142 151 if($Action == 'PasswordRecoveryConfirm') … … 149 158 $Form->SetClass('UserRegister'); 150 159 $Form->LoadValuesFromForm(); 151 $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'], 152 $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'] , $Form->Values['PhoneNumber'], $Form->Values['ICQ']);160 $Result = $this->System->User->Register($Form->Values['Login'], $Form->Values['Password'], 161 $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name']); 153 162 $Output .= $this->SystemMessage('Registrace nového účtu', $Result); 154 if($Result <> USER_REGISTRATED) 163 if($Result <> USER_REGISTRATED) 155 164 { 156 165 $Form->OnSubmit = '?Action=UserRegisterSave'; 157 166 $Output .= $Form->ShowEditForm(); 158 167 } 159 } else 168 } else 160 169 if($Action == 'UserMenu') 161 170 { … … 163 172 } else $Output = $this->ShowMain(); 164 173 } else $Output = $this->ShowMain(); 165 return($Output); 174 return($Output); 166 175 } 167 176 168 177 function ShowMain() 169 178 {
Note:
See TracChangeset
for help on using the changeset viewer.