- Timestamp:
- Sep 14, 2008, 5:54:37 PM (16 years ago)
- Location:
- devel/www
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/www/config.sample.php
r89 r107 27 27 ), 28 28 ), 29 'Finance' => array( 30 'MainUserId' => 1, 31 ), 29 32 'Network' => array( 30 33 'MaxSubnetCount' => 7, -
devel/www/finance/bill.php
r87 r107 3 3 include('../global.php'); 4 4 5 $ InvoiceGenerator->ShowStoredBill($_GET['id']);5 $System->Modules['Bill']->ShowStoredBill($_GET['Id']); 6 6 7 7 ?> -
devel/www/finance/bills.php
r98 r107 1 1 <?php 2 //include_once('global.php');3 2 4 3 class Bill extends Module … … 8 7 function GenerateInvoice($BillId) 9 8 { 10 global $SpecificSymbol ;9 global $SpecificSymbol, $Config; 11 10 12 11 $DbResult = $this->Database->select('finance_bills', '*', 'id='.$BillId); 13 12 $Bill = $DbResult->fetch_array(); 14 13 15 14 $DbResult = $this->Database->select('users', '*', 'id='.$Bill['user_id']); 16 15 $User = $DbResult->fetch_array(); 16 $DbResult = $this->Database->select('users', '*', 'id='.$Config['Finance']['MainUserId']); 17 $MainUser = $DbResult->fetch_array(); 17 18 18 19 $Dodavka = array(); … … 20 21 while($Item = $DbResult->fetch_array()) 21 22 { 22 $Dodavka[$Item['id']] = $Item; 23 $Dodavka[$Item['id']] = $Item; 23 24 } 24 25 … … 27 28 '<hr></td></tr>'. 28 29 '<tr><td valign="top" width="50%"><strong>Dodavatel:</strong><br>'. 29 'Ing. Jiří Hajda<br>'.30 'Zděchov 208<br>'.31 '75607 Zděchov<br>'.32 'IČO: 75904535<br>'.33 'DIČ: CZ8303255884<br>'.30 $MainUser['subject_name'].'<br>'. 31 $MainUser['street'].'<br>'. 32 $MainUser['psc'].' '.$User['town'].'<br>'. 33 'IČO: '.$MainUser['ico'].'<br>'. 34 'DIČ: '.$MainUser['dic'].'<br>'. 34 35 'Účet: 218098370 / 0300<br>'. 35 36 'Nejsem plátce DPH<br>'. … … 50 51 'Specifický symbol: '.$this->SpecificSymbol.'<br>'. 51 52 'Konstantní symbol:<br>'. 52 ' Způsob úhrady: převodem'.53 'Doporučený způsob úhrady: převodem'. 53 54 '</td><td valign="top">'. 54 55 '<br>'. … … 96 97 } 97 98 98 $Output = '<table width="100%"><tr><td colspan="2">'. 99 '<font size="6"><div align="center">Faktura - daňový doklad</font></div>'. 100 '<hr></td></tr>'. 101 '<tr><td valign="top" width="50%"><strong>Dodavatel:</strong><br>'. 99 $Output = '<table width="100%"><tr><td>'. 100 '<td valign="top" width="50%"><strong>Firma:</strong><br>'. 102 101 'Ing. Jiří Hajda<br>'. 103 102 'Zděchov 208<br>'. … … 105 104 'IČO: 75904535<br>'. 106 105 'DIČ: CZ8303255884<br>'. 107 'Účet: 218098370 / 0300<br>'.108 106 'Nejsem plátce DPH<br>'. 109 107 '</td><td valign="top">'. 108 '<font size="6"><div align="center">JEDNODUCHÝ PŘIJMOVÝ POKLADNÍ DOKLAD č.</font></div>'. 109 'Datum vystavení: '.HumanDate($Bill['time_create']).'<br></td>'. 110 'Přijato od: <br>'. 111 112 110 113 '<strong>Odběratel:</strong><br>'. 111 114 $User['subject_name'].'<br>'. … … 126 129 '</td><td valign="top">'. 127 130 '<br>'. 128 'Datum vystavení: '.HumanDate($Bill['time_create']).'<br>'.129 131 'Datum splatnosti: '.HumanDate($Bill['time_due']).'<br>'. 130 132 'Fakturované období: '.HumanDate($Bill['time_from']).' - '.HumanDate($Bill['time_to']).'<br>'. -
devel/www/finance/clenove.php
r87 r107 13 13 global $Tarify; 14 14 15 if($this->System->Modules['User']->CheckPermission('Finance', ' UserList'))15 if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) 16 16 { 17 17 // Seznam členů -
devel/www/finance/index.php
r100 r107 16 16 $Output .= '<table><tr><td width="30%">'; 17 17 $Output .= '<a href="zarizeni.php">Výpis zařízení</a><br />'; 18 if($this->System->Modules['User']->CheckPermission('Finance', ' UserList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />';18 if($this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) $Output .= '<a href="clenove.php">Seznam členů</a><br />'; 19 19 $Output .= '<a href="spotreba.php">Spotřeba energie</a><br />'; 20 20 $Output .= '<a href="'.$Config['Web']['RootFolder'].'/aktuality/index.php?category=9">Investice v síti</a><br />'; -
devel/www/finance/user_state.php
r87 r107 14 14 global $Tarify, $Sprava; 15 15 16 if(!$this->System->Modules['User']->CheckPermission('Finance', ' UserState')) return('Nemáte oprávnění');16 if(!$this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) return('Nemáte oprávnění'); 17 17 18 18 $UserId = $this->System->Modules['User']->User['Id']; … … 25 25 // Tabulka operaci 26 26 $Output .= 'Výpis operací pro účastníka '.$Row2['fullname'].':<br>'; 27 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Datum</th><th>Popis</th><th> Doklad</th><th>Komentář</th></tr>';27 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>'; 28 28 $Operations = array(); 29 29 $DbResult = $this->Database->query('(SELECT Time, Value, Text, Bill FROM FinanceCashFlow WHERE Subject='.$UserId.') UNION ALL '. 30 '(SELECT TimeCreation as Time, (-Value)as Value, Text, Bill FROM FinanceClaimsLiabilities WHERE Subject='.$UserId.') ORDER BY Time DESC');30 '(SELECT TimeCreation as Time, -Value as Value, Text, Bill FROM FinanceClaimsLiabilities WHERE Subject='.$UserId.') ORDER BY Time DESC'); 31 31 while($DbRow = $DbResult->fetch_array()) 32 32 $Operations[] = $DbRow; 33 33 foreach($Operations as $Row) 34 34 { 35 if($Row['Value'] == -0) $Row['Value'] = 0; 35 36 if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 36 if($Row['Bill'] > 0) $Invoice = '<a href=" ?show=bill&id='.$Row['Bill'].'">PDF</a>'; else $Invoice = ' ';37 $Output .= '<tr><td align="right">'.HumanDate($Row['Time']).'</td><td>'.$Row['Text'].'</td><td >'.$Row['Value'].'</td><td>'.$Invoice.'</td></tr>';37 if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">PDF</a>'; else $Invoice = ' '; 38 $Output .= '<tr><td align="right">'.HumanDate($Row['Time']).'</td><td>'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>'; 38 39 } 39 40 //echo('<tr><td> </td><td>-'.$Row2['network_device'].'</td><td>Proměnná cena za zařízení</td></tr> -
devel/www/index.php
r101 r107 41 41 'search' => array('Vyhledávání', 42 42 array('Google', 'http://www.google.cz/', 'www_google_com.gif'), 43 array('Morfeo', 'http://morfeo.centrum.cz ', 'morfeo.png'),44 array('Centrum', 'http://www.centrum.cz ', 'www_centrum_cz.gif'),45 array('Seznam', 'http://www.seznam.cz ', 'www_seznam_cz.gif'),46 array('Atlas', 'http://www.atlas.cz ', 'www_atlas_cz.gif'),47 array('Tiscali', 'http://www.tiscali.cz ', 'www_tiscali_cz.gif'),43 array('Morfeo', 'http://morfeo.centrum.cz/', 'morfeo.png'), 44 array('Centrum', 'http://www.centrum.cz/', 'www_centrum_cz.gif'), 45 array('Seznam', 'http://www.seznam.cz/', 'www_seznam_cz.gif'), 46 array('Atlas', 'http://www.atlas.cz/', 'www_atlas_cz.gif'), 47 array('Tiscali', 'http://www.tiscali.cz/', 'www_tiscali_cz.gif'), 48 48 ), 49 49 'usefull' => array('Užitečné', … … 115 115 //$Output .= 'Server běží: '.$this->GetServerUptime().' '; 116 116 117 if($this->System->Modules['User']->CheckPermission('Finance', ' UserState'))117 if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState')) 118 118 { 119 119 $DbResult = $this->Database->select('users', 'cash', 'User='.$this->System->Modules['User']->User['Id']); -
devel/www/is/restart.php
r89 r107 12 12 function Show() 13 13 { 14 if(!$this->System->Modules['User']->CheckPermission('Network', ' RestartService')) return('Nemáte oprávnění');14 if(!$this->System->Modules['User']->CheckPermission('Network', 'Administration')) return('Nemáte oprávnění'); 15 15 16 16 if(array_key_exists('set', $_POST)) -
devel/www/network/dostupnost.php
r102 r107 16 16 $Output .= '<br /><table style="font-size: small;" cellspacing="0" cellpadding="3" border="1">'; 17 17 $Output .= '<tr><th>Jméno</th><th>Hodina [%]</th><th>Den [%]</th><th>Týden [%]</th><th>Měsíc [%]</th><th>Year [%]</th></tr>'; 18 $DbResult = $this->Database->query('SELECT hosts.name, PeriodHour.Percent as Hour, PeriodDay.Percent as Day, PeriodWeek.Percent as Week, PeriodMonth.Percent as Month, PeriodYear.Percent as Year FROM hosts LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 1 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 1 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodHour ON PeriodHour.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodDay ON PeriodDay.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 7 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 7 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodWeek ON PeriodWeek.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 30 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodMonth ON PeriodMonth.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 365 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodYear ON PeriodYear.host_id=hosts.id WHERE hosts.used=1 AND hosts.show_online=0 ');18 $DbResult = $this->Database->query('SELECT hosts.name, PeriodHour.Percent as Hour, PeriodDay.Percent as Day, PeriodWeek.Percent as Week, PeriodMonth.Percent as Month, PeriodYear.Percent as Year FROM hosts LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 1 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 1 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodHour ON PeriodHour.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodDay ON PeriodDay.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 7 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 7 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodWeek ON PeriodWeek.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 30 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodMonth ON PeriodMonth.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 365 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodYear ON PeriodYear.host_id=hosts.id WHERE hosts.used=1 AND hosts.show_online=0 GROUP BY hosts.IP ORDER BY name'); 19 19 echo($this->Database->error); 20 20 while($Row = $DbResult->fetch_array()) -
devel/www/page.php
r102 r107 22 22 'map' => array('', 23 23 'index.php' => 'Mapa', 24 ), 25 'network' => array('', 26 'dostupnost.php' => 'Dostupnost zařízení', 24 27 ), 25 28 'nabidky_pripojeni.php' => 'Nabídky připojení', -
devel/www/temp/transform.php
r102 r107 129 129 $Output = ''; 130 130 131 // Init User table from users 131 // Clear previous content 132 $this->Database->query('TRUNCATE TABLE PermissionOperation'); 133 $this->Database->query('TRUNCATE TABLE PermissionGroup'); 134 $this->Database->query('TRUNCATE TABLE PermissionGroupAssignment'); 135 $this->Database->query('TRUNCATE TABLE PermissionUserAssignment'); 132 136 $this->Database->query('TRUNCATE TABLE User'); 133 137 $this->Database->query('TRUNCATE TABLE Subject'); 134 138 139 // Init permission groups 140 $this->Database->insert('PermissionGroup', array('Description' => 'Ostatní')); 141 $PermissionGroupOthers = $this->Database->insert_id; 142 $this->Database->insert('PermissionGroup', array('Description' => 'Členové sítě')); 143 $PermissionGroupMembers = $this->Database->insert_id; 144 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $PermissionGroupOthers, 'Type' => 'Group')); 145 echo($this->Database->LastQuery); 146 $this->Database->insert('PermissionGroup', array('Description' => 'Zástupci za domácnost')); 147 $PermissionGroupSubjects = $this->Database->insert_id; 148 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $PermissionGroupMembers, 'Type' => 'Group')); 149 $this->Database->insert('PermissionGroup', array('Description' => 'Správci sítě')); 150 $PermissionGroupNetworkAdmins = $this->Database->insert_id; 151 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $PermissionGroupSubjects, 'Type' => 'Group')); 152 $this->Database->insert('PermissionGroup', array('Description' => 'Systémoví administrátoři')); 153 $PermissionGroupAdmin = $this->Database->insert_id; 154 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupAdmin, 'GroupOrOperation' => $PermissionGroupNetworkAdmins, 'Type' => 'Group')); 155 156 // Init permission operations 157 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Display', 'Item' => 'Item')); 158 $OperationId = $this->Database->insert_id; 159 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 160 161 $DbResult = $this->Database->select('news_category', 'id, permission'); 162 while($DbRow = $DbResult->fetch_array()) 163 { 164 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Insert', 'Item' => 'Group', 'ItemId' => $DbRow['id'])); 165 $OperationIdInsert = $this->Database->insert_id; 166 $this->Database->insert('PermissionOperation', array('Module' => 'News', 'Operation' => 'Display', 'Item' => 'Group', 'ItemId' => $DbRow['id'])); 167 $OperationIdDisplay = $this->Database->insert_id; 168 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationIdDisplay, 'Type' => 'Operation')); 169 if($DbRow['permission'] == 1) 170 { 171 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOoperation' => $OperationIdInsert, 'Type' => 'Operation')); 172 } else 173 { 174 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationIdInsert, 'Type' => 'Operation')); 175 } 176 } 177 178 $this->Database->insert('PermissionOperation', array('Module' => 'Chat', 'Operation' => 'Display')); 179 $OperationId = $this->Database->insert_id; 180 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupOthers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 181 182 $this->Database->insert('PermissionOperation', array('Module' => 'Share', 'Operation' => 'Display')); 183 $OperationId = $this->Database->insert_id; 184 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 185 186 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'DisplaySubjectState')); 187 $OperationId = $this->Database->insert_id; 188 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupSubjects, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 189 190 $this->Database->insert('PermissionOperation', array('Module' => 'EatingPlace', 'Operation' => 'Edit')); 191 $OperationId = $this->Database->insert_id; 192 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupMembers, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 193 194 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'Manage')); 195 $OperationId = $this->Database->insert_id; 196 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 197 198 $this->Database->insert('PermissionOperation', array('Module' => 'Network', 'Operation' => 'Edit')); 199 $OperationId = $this->Database->insert_id; 200 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 201 202 $this->Database->insert('PermissionOperation', array('Module' => 'Finance', 'Operation' => 'SubjectList')); 203 $OperationId = $this->Database->insert_id; 204 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 205 206 $this->Database->insert('PermissionOperation', array('Module' => 'Log', 'Operation' => 'Show')); 207 $OperationId = $this->Database->insert_id; 208 $this->Database->insert('PermissionGroupAssignment', array('Group' => $PermissionGroupNetworkAdmins, 'GroupOrOperation' => $OperationId, 'Type' => 'Operation')); 209 210 // Init User table from users 135 211 $DbResult = $this->Database->select('users', '*'); 136 212 while($DbRow = $DbResult->fetch_array()) 137 213 { 138 214 $this->Database->insert('User', array('Id' => $DbRow['id'], 'Name' => $DbRow['nick'], 'FirstName' => $DbRow['first_name'], 'SecondName' => $DbRow['second_name'], 'PhoneNumber' => $DbRow['phone'], 'Password' => substr(sha1(strtoupper($DbRow['nick'])), 0, 7), 'ICQ' => $DbRow['icq'], 'Email' => $DbRow['email'], 'Locked' => 0)); 215 $UserId = $this->Database->insert_id; 216 if($DbRow['id'] == 1) 217 { 218 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupAdmin, 'Type' => 'Group')); 219 } else 139 220 if($DbRow['role'] == 2) 140 221 { 141 222 $this->Database->insert('Subject', array('Id' => $DbRow['id'], 'Name' => $DbRow['subject_name'], 'AddressStreet' => $DbRow['street'], 'AddressTown' => $DbRow['town'], 'AddressPSC' => $DbRow['psc'], 'IC' => $DbRow['ico'], 'DIC' => $DbRow['dic'], 'FamilyMemberCount' => $DbRow['family'], 'MapPositionX' => $DbRow['PositionX'], 'MapPositionY' => $DbRow['PositionY'], 'NetworkSegment' => $DbRow['network_segment'], 'InternetTariffCurrentMonth' => $DbRow['inet_tarif_now'], 'InternetTariffNextMonth' => $DbRow['inet_tarif_next'], 'MembershipDate' => $DbRow['membership_date'])); 142 } 223 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupSubjects, 'Type' => 'Group')); 224 } else 225 $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => $PermissionGroupMembers, 'Type' => 'Group')); 143 226 } 144 227 228 // Insert anonymous user 145 229 $this->Database->insert('User', array('Name' => 'Anonym', 'Password' => 'dsafafdfadfs', 'Locked' => 0)); 146 $Output .= $this->Database->insert_id; 147 230 $Output .= 'Anonymní uživatel: '.$this->Database->insert_id.'</ br>'; 231 $AnonymousUserId = $this->Database->insert_id; 232 $this->Database->insert('PermissionUserAssignment', array('User' => $AnonymousUserId, 'GroupOrOperation' => $PermissionGroupOthers, 'Type' => 'Group')); 233 234 // Init subjects open time 148 235 $this->SubjectOpenTime(); 149 236 … … 151 238 //$this->Database->query('TRUNCATE TABLE ChatHistory'); 152 239 //$this->Database->query('INSERT INTO ChatHistory (SELECT id as Id, nick as Nick, text as Text, time as Time, color as Color, roomname as RoomName, roomtype as RoomType, "" as Host FROM `sunrisechat_history`)'); 240 241 153 242 return($Output); 154 243 } -
devel/www/user.php
r101 r107 91 91 else 92 92 { 93 $this->Database->insert('User', array('Name' => $Nick, 'FirstName' => $FirstName, 'SecondName' => $SecondName, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()' ));93 $this->Database->insert('User', array('Name' => $Nick, 'FirstName' => $FirstName, 'SecondName' => $SecondName, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1)); 94 94 $UserId = $this->Database->insert_id; 95 95 … … 251 251 if(($NewPassword == $NewPassword2) and ($Hash == $Row['Password'])) 252 252 { 253 $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => sha1($NewPassword) ));253 $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => sha1($NewPassword), 'Locked' => 0)); 254 254 $Output = USER_PASSWORD_RECOVERY_CONFIRMED; 255 255 $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Username='.$Row['Name']);
Note:
See TracChangeset
for help on using the changeset viewer.