Changeset 22
- Timestamp:
- Jun 12, 2009, 8:56:03 PM (15 years ago)
- Location:
- trunk/www
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/form_classes.php
r21 r22 80 80 'Items' => array( 81 81 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 82 'UserName' => array('Type' => 'String', 'Caption' => 'Správce', 'Default' => ''),83 82 'NetworkPortRealmd' => array('Type' => 'Integer', 'Caption' => 'Realmlist', 'Default' => ''), 84 83 'Version' => array('Type' => 'Integer', 'Caption' => 'Verze', 'Default' => 0), … … 87 86 'AccountCount' => array('Type' => 'Integer', 'Caption' => 'Účtů', 'Default' => 0), 88 87 'CharacterCount' => array('Type' => 'Integer', 'Caption' => 'Postav', 0), 88 'UserName' => array('Type' => 'String', 'Caption' => 'Správce', 'Default' => ''), 89 89 ), 90 90 ), … … 117 117 RegisterType('ServerType', 'Enumeration', array('Normální', 'PvP', 'RP', 'RPPvP')); 118 118 RegisterType('OnlineState', 'Enumeration', array('Neaktivní', 'Aktivní')); 119 120 //RegisterType('Database', 'PointerOneToOne', array('Table' => 'Database', 'Id' => 'Id', 'Name' => 'CONCAT(Name, " ", Version, " r", Revision)')); 119 RegisterType('Database', 'PointerOneToOne', array('Table' => 'Database', 'Id' => 'Id', 'Name' => 'CONCAT(Name, " ", Version, " r", Revision)')); 121 120 122 121 ?> -
trunk/www/page.php
r21 r22 57 57 $Time = round(GetMicrotime() - $ScriptTimeStart, 2); 58 58 $Output = '<div id="Footer"> 59 <i>| Projekt: WoW hosting | Správce: '.$this->System->Config['Web']['Admin'].' | E-mail: '.$this->System->Config['Web']['AdminEmail'].' | <a href="http://svn.zdechov.net/trac/wowhosting/browser">Zdrojové kódy</a> | ';59 <i>| Projekt: WoW hosting | Správce: '.$this->System->Config['Web']['Admin'].' | E-mail: '.$this->System->Config['Web']['AdminEmail'].' | <a href="http://svn.zdechov.net/trac/wowhosting/browser">Zdrojové kódy</a> | <a href="http://svn.zdechov.net/trac/wowhosting/log?verbose=on">Změny</a>|'; 60 60 if($this->System->Config['Web']['ShowRuntimeInfo'] == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; 61 61 $Output .= '</i></div></body></html>'; -
trunk/www/task.php
r20 r22 26 26 { 27 27 $this->Database->query('UPDATE Task SET State="Running" WHERE Id='.$Task['Id']); 28 echo('Provádím '.$Task['Title']."...\n");28 echo('Provádím úlohu '.$Task['Id'].': '.$Task['Title']."...\n"); 29 29 $Task['CommandList'] = "#!/bin/sh\n".$Task['CommandList']; 30 30 file_put_contents($this->TempScript, $Task['CommandList']); -
trunk/www/types/PointerOneToOne.php
r11 r22 3 3 class TypePointerOneToOne extends TypeBase 4 4 { 5 function GetTablePointerName($Type, $Item)6 {7 global $Database;8 9 //print_r($Item);10 $Columns = '';11 $List = GetListDefinition($Type['Parameters'][0]);12 $TargetTable = $List['TableName'];13 //echo($TargetTable.'<');14 //print_r($List);15 foreach($List['Items'] as $Index => $ListItem)16 {17 //echo('ListItem');18 //print_r($ListItem);19 $Type = GetTypeDefinition($ListItem['Type']);20 if($ListItem['VisibleInPointer'] == 1)21 {22 if($Type['ParentType'] == TypePointerOneToOneId)23 {24 //print_r($Type);25 $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $List['TableName'], 'Condition' => $List['IdName'].'='.$Item['Value']));26 $DbRow = $DbResult->fetch_assoc();27 $DefinitionItem = array('Name' => $Index, 'Type' => $Item['Type'], 'Caption' => $Item['TextBefore'], 'Value' => $DbRow[$Index], 'SourceTable' => $List['Id'], 'SourceItemId' => 0);28 $SubTarget = $this->GetTablePointerName($Type, $DefinitionItem);29 $Columns .= '"'.$SubTarget['Name'].' ",';30 } else $Columns .= '`'.$ListItem['Name'].'`," ",';31 }32 }33 $Columns = substr($Columns, 0, -1);34 if($Columns == '') $Columns = '`'.$List['IdName'].'` AS `Name`, `'.$List['IdName'].'`';35 else $Columns = 'CONCAT('.$Columns.') AS `Name`, `'.$List['IdName'].'`';36 $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $TargetTable, 'Columns' => $Columns, 'Condition' => $List['IdName'].'='.$Item['Value']));37 //echo($Database->LastQuery);38 if($DbResult->num_rows > 0)39 {40 return($DbResult->fetch_assoc());41 } else return('');42 }43 44 function GetTablePointerNameList($Type, $Item)45 {46 global $Database;47 48 $Columns = '';49 $List = GetListDefinition($Type['Parameters'][0]);50 $TargetTable = $List['TableName'];51 foreach($List['Items'] as $ListItem)52 if($ListItem['VisibleInPointer'] == 1) $Columns .= '`'.$ListItem['Name'].'`," ",';53 $Columns = 'CONCAT('.substr($Columns, 0, -1).') AS Name, `'.$List['IdName'].'`';54 $DbResult = $Database->select(array('Database' => $List['Database'], 'Table' => $TargetTable, 'Columns' => $Columns));55 //echo($Database->LastQuery);56 if($DbResult->num_rows > 0)57 {58 59 $Result = array(array('Name' => 'Žádný', 'Id' => 0));60 while($DbRow = $DbResult->fetch_assoc())61 $Result[] = $DbRow;62 return($Result);63 } else return(array());64 }65 66 5 function OnView($Item) 67 6 { 68 global $Database ;7 global $Database, $TypeDefinitionList; 69 8 70 $Type = GetTypeDefinition($Item['Type']); 9 $Type = $TypeDefinitionList[$Item['Type']]; 10 $DbResult = $Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name FROM `'.$Type['Parameters']['Table'].'` WHERE `'.$Type['Parameters']['Id'].'`='.$Item['Value']); 11 $DbRow = $DbResult->fetch_assoc(); 12 $Output = $DbRow['Name']; 13 14 /* $Type = GetTypeDefinition($Item['Type']); 71 15 $List = GetListDefinition($Type['Parameters'][0]); 72 16 $TargetTable = $Type['Parameters'][0]; … … 74 18 if($TargetName != '') $Output = '<a href="?Action=ViewItem&Table='.$TargetTable.'&Item='.$TargetName[$List['IdName']].'">'.$TargetName['Name'].'</a>'; 75 19 else $Output = ''; 20 */ 76 21 return($Output); 77 22 } … … 79 24 function OnEdit($Item) 80 25 { 81 global $Database, $Type s;26 global $Database, $TypeDefinitionList; 82 27 83 $Type = $Types[$Item['Type']];84 $List = GetListDefinition($Type['Parameters'][0]);85 28 $Output = '<select name="'.$Item['Name'].'">'; 86 $T argetNameList = $this->GetTablePointerNameList($Type, $Item);87 //echo($Database->LastQuery);88 foreach($TargetNameList as $TargetName)29 $Type = $TypeDefinitionList[$Item['Type']]; 30 $DbResult = $Database->query('SELECT '.$Type['Parameters']['Name'].' AS Name,'.$Type['Parameters']['Id'].' AS Id FROM `'.$Type['Parameters']['Table'].'`'); 31 while($DbRow = $DbResult->fetch_assoc()) 89 32 { 90 if($Item['Value'] == $ TargetName[$List['IdName']]) $Selected = ' selected="1"'; else $Selected = '';91 $Output .= '<option value="'.$ TargetName[$List['IdName']].'"'.$Selected.'>'.$TargetName['Name'].'</option>';33 if($Item['Value'] == $DbRow['Id']) $Selected = ' selected="1"'; else $Selected = ''; 34 $Output .= '<option value="'.$DbRow['Id'].'"'.$Selected.'>'.$DbRow['Name'].'</option>'; 92 35 } 93 36 $Output .= '</select>'; -
trunk/www/user.php
r20 r22 102 102 else 103 103 { 104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2));104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => $Password, 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2)); 105 105 $UserId = $this->Database->insert_id; 106 106 107 107 $Subject = FromUTF8('Registrace nového účtu', 'iso2'); 108 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].' ">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte.";108 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."/</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$Password.'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$Password.'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte."; 109 109 $AdditionalHeaders = "To: ".$Name." <".$Email.">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 110 110 mail($Email, $Subject, $Message, $AdditionalHeaders);
Note:
See TracChangeset
for help on using the changeset viewer.