Ignore:
Timestamp:
Aug 15, 2013, 11:17:26 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: System variable as parameter to constructors of descendents of Module class.
  • Removed: End PHP mark "?>" from all files.
Location:
trunk/www/Application/Model
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/Application/Model/Backup.php

    r80 r93  
    88  var $Task;
    99 
    10   function __construct($Database, $Id)
     10  function __construct($System, $Id)
    1111  {
    12     $this->Database = $Database;
    13     $this->Task = new Task($Database);
     12        parent::__construct($System);
     13    $this->Task = new Task($System);
    1414    $this->Id = $Id;
    1515    $DbResult = $this->Database->query('SELECT * FROM `Backup` WHERE `Id`='.$Id);
     
    4242  function Create($ServerId)
    4343  {
    44     $Server = new Server($this->Database, $ServerId);
     44    $Server = new Server($this->System, $ServerId);
    4545    $Description = 'MaNGOS r'.$Server->Server['Database']['Emulator']['Revision'].', UDB r'.$Server->Server['Database']['Revision'].', SD2 r'.$Server->Server['Database']['ScriptDev2Revision'].', Client '.$Server->Server['Database']['Emulator']['Client']['Version'];
    4646    $this->Database->insert('Backup', array('Server' => $ServerId, 'Time' => 'NOW()', 'Description' => $Description, 'Lock' => 1, 'Database' => $Server->Server['Database']['Id']));
     
    7373  }
    7474}
    75 
    76 ?>
  • trunk/www/Application/Model/Cluster.php

    r78 r93  
    77  function __construct($System, $Id)
    88  {
    9     $this->System = $System;
    10     $this->Config = $System->Config;
    11     $this->Database = $System->Database;
     9        parent::__construct($System);
    1210   
    1311    $DbResult = $this->Database->query('SELECT * FROM `ClusterNode` WHERE `Id`='.$Id);
     
    3129  } 
    3230}
    33 
    34 ?>
  • trunk/www/Application/Model/ClusterList.php

    r78 r93  
    1313  } 
    1414}
    15 
    16 ?>
  • trunk/www/Application/Model/Emulator.php

    r78 r93  
    99  var $Task;
    1010 
    11   function __construct($Database, $Id)
     11  function __construct($System, $Id)
    1212  {
    13     $this->Database = $Database;
    14     $this->Task = new Task($Database);
     13    parent::__construct($System);
     14    $this->Task = new Task($System);
    1515    $this->Id = $Id;
    1616    $DbResult = $this->Database->query('SELECT * FROM `Emulator` WHERE `Id`='.$Id);
     
    3535  function Download()
    3636  {
    37     global $Config;
    38    
    3937    $this->Lock();
    4038    $this->Task->Add('Stažení emulátoru', array(
    4139      'php www/shell.php EmulatorLock '.$this->Id,
    42       'mkdir '.$Config['BaseDir'].'emulator/'.$this->Id.'/',
    43       'cd '.$Config['BaseDir'].'emulator/'.$this->Id.'/',
     40      'mkdir '.$this->Config['BaseDir'].'emulator/'.$this->Id.'/',
     41      'cd '.$this->Config['BaseDir'].'emulator/'.$this->Id.'/',
    4442      'git clone git://github.com/mangos/mangos.git source',
    4543      'cd source',
     
    5553  function Compile()
    5654  {
    57     global $Config;
    58    
    5955    $this->Lock();
    6056    $this->Task->Add('Překlad emulátoru', array(
    6157      'php www/shell.php EmulatorLock '.$this->Id,
    62       'cd '.$Config['BaseDir'].'emulator/'.$this->Id.'/source',
     58      'cd '.$this->Config['BaseDir'].'emulator/'.$this->Id.'/source',
    6359      'autoreconf -ifv',
    6460      'mkdir objdir',
    6561      'cd objdir',
    66       'export CFLAGS="-g -ggdb '.$Config['CompilerParameters'].'"',
    67       'export CXXFLAGS="-g -ggdb '.$Config['CompilerParameters'].'"',
    68       '../configure --prefix='.$Config['BaseDir'].'emulator/'.$this->Id.'/ --enable-cli --enable-ra',
     62      'export CFLAGS="-g -ggdb '.$this->Config['CompilerParameters'].'"',
     63      'export CXXFLAGS="-g -ggdb '.$this->Config['CompilerParameters'].'"',
     64      '../configure --prefix='.$this->Config['BaseDir'].'emulator/'.$this->Id.'/ --enable-cli --enable-ra',
    6965      'make',
    7066      'make install',
     
    9995  }
    10096}
    101 
    102 ?>
  • trunk/www/Application/Model/History.php

    r78 r93  
    1111  var $Resolution = 1000;
    1212 
    13   function __construct($Database, $ServerId, $MeasureId)
     13  function __construct($System, $ServerId, $MeasureId)
    1414  {
    15     $this->Database = $Database;
     15    parent::__construct($System);
    1616    $this->ServerId = $ServerId;
    1717    $this->MeasureId = $MeasureId;
     
    5959  }
    6060}
    61 
    62 ?>
  • trunk/www/Application/Model/MangosConfigurationFile.php

    r78 r93  
    77  var $ParameterList;
    88 
    9   function __construct($Database)
     9  function __construct($System)
    1010  {
    11     $this->Database = $Database;
     11    parent::__construct($System);
    1212    $this->Parameters = array();
    1313  }
     
    4141  }
    4242}
    43 
    44 ?>
  • trunk/www/Application/Model/MangosDebug.php

    r78 r93  
    88  var $MaxMangosThreadCount = 12;
    99 
    10   function __construct($Database)
     10  function __construct($System)
    1111  {
    12     $this->Database = $Database;
     12    parent::__construct($System);
    1313  }
    1414 
    1515  function ProcessLog($RealmId)
    1616  {
    17     global $Config;
    18    
    1917    $Output = '';
    2018    // Read server Id from first parameter
    21     $Realm = new Realm($this->Database, $RealmId);
     19    $Realm = new Realm($this->System, $RealmId);
    2220   
    2321    $LogDir = '../realm/'.$RealmId.'/log/';
     
    104102  }
    105103}
    106 
    107 ?>
  • trunk/www/Application/Model/Permission.php

    r78 r93  
    4646  }
    4747}
    48 
    49 ?>
  • trunk/www/Application/Model/Platform.php

    r78 r93  
    77  var $Id;
    88 
    9   function __construct($Database)
     9  function __construct($System)
    1010  {
    11     $this->Database = $Database;
     11    parent::__construct($System);
    1212  }
    1313 
     
    4646  function State()
    4747  {
    48     global $Config;
    49    
    5048    $State = array();
    5149    $State['MemoryUsed'] = $this->MemoryUsage();
     
    7674    $DbRow = $DbResult->fetch_row();
    7775    $State['TaskQueued'] = $DbRow[0];
    78     $State['ServerMaxCount'] = $Config['MaxServerCount'];
     76    $State['ServerMaxCount'] = $this->Config['MaxServerCount'];
    7977    return($State);
    8078  } 
    8179}
    82 
    83 ?>
  • trunk/www/Application/Model/Realm.php

    r78 r93  
    99  var $Task;
    1010 
    11   function __construct($Database, $Id)
    12   {
    13     $this->Database = $Database;
    14     $this->Task = new Task($Database);
     11  function __construct($System, $Id)
     12  {
     13    parent::__construct($System);
     14    $this->Task = new Task($System);
    1515    $this->Id = $Id;
    1616    $DbResult = $this->Database->query('SELECT * FROM `Realm` WHERE `Id`='.$Id);
     
    3131
    3232  function GetState()
    33   {
    34     global $System;
    35    
     33  {   
    3634    $State = array();
    37     $State['WorlddPortState'] = $System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']);
     35    $State['WorlddPortState'] = $this->System->NetworkPortState('localhost', $this->Data['NetworkPortWorldd']);
    3836    $State['Online'] = $State['WorlddPortState'];
    3937    $State['Uptime'] = $this->Uptime();
     
    140138  function UpdateRealmlist()
    141139  {
    142     $Server = new Server($this->Database, $this->Data['Server']);
     140    $Server = new Server($this->System, $this->Data['Server']);
    143141    $Server->UpdateRealmList();
    144142  }
     
    153151  function UpdateScripts()
    154152  {
    155     global $Config;
    156    
    157153    $RealmBinDir = '../realm/'.$this->Id.'/bin/';
    158154    if(!file_exists($RealmBinDir)) mkdir($RealmBinDir, 0777, true);   
     
    165161      'info thread',
    166162    );
    167     for($I = 1; $I < $Config['MangosWorlddThreadCountMax']; $I++)
     163    for($I = 1; $I < $this->Config['MangosWorlddThreadCountMax']; $I++)
    168164      $Content[] = 'thread apply '.$I.' bt full';
    169165    file_put_contents($ScriptFileName, implode("\n", $Content));
     
    209205  function SetupConfigurationFiles()
    210206  {
    211     global $Config;
    212    
    213207    $EmulatorEtcDir = '../emulator/'.$this->Data['Database']['Emulator']['Id'].'/etc/';
    214208    $RealmEtcDir = '../realm/'.$this->Id.'/etc/';
     
    220214    if(!file_exists($RealmEtcDir.'mangosd.conf'))
    221215      file_put_contents($RealmEtcDir.'mangosd.conf', file_get_contents($EmulatorEtcDir.'mangosd.conf.dist'));
    222     $EmulatorConfig = new MangosConfigurationFile($this->Database);
     216    $EmulatorConfig = new MangosConfigurationFile($this->System);
    223217    $EmulatorConfig->Load($RealmEtcDir.'mangosd.conf');
    224218    $EmulatorConfig->ParameterList['RealmID'] = $this->Data['Id'];
     
    235229     
    236230    // scriptdev2.conf
    237     $EmulatorConfig = new MangosConfigurationFile($this->Database);
     231    $EmulatorConfig = new MangosConfigurationFile($this->System);
    238232    $EmulatorConfig->Load($EmulatorEtcDir.'scriptdev2.conf');
    239233    $EmulatorConfig->ParameterList['ScriptDev2DatabaseInfo'] = 'localhost;3306;server'.$this->Data['Server'].';server'.$this->Data['Server'].';realm'.$this->Id.'_scriptdev2';
     
    255249    if($DoBackup)
    256250    {
    257       $Backup = new Backup($this->Database, 0);
     251      $Backup = new Backup($this->System, 0);
    258252      $Output .= '<br />'.$Backup->Create($this->Id);
    259253    }
     
    364358    while($DbRow = $DbResult->fetch_assoc())
    365359    {
    366       $Realm = new Realm($this->Database, $DbRow['Id']);   
     360      $Realm = new Realm($this->System, $DbRow['Id']);   
    367361      $Realm->UpdateState();
    368362    }   
     
    380374  }
    381375}
    382 
    383 ?>
  • trunk/www/Application/Model/RealmList.php

    r78 r93  
    1212    while($DbRow = $DbResult->fetch_assoc())
    1313    {
    14       $Server = new Server($this->Database, $DbRow['Id']);
     14      $Server = new Server($this->System, $DbRow['Id']);
    1515      $Total += $Server->RealmCount();
    1616    }
     
    1818  }
    1919}
    20 
    21 ?>
  • trunk/www/Application/Model/RemoteConsole.php

    r79 r93  
    4949  }
    5050}
    51 
    52 ?>
  • trunk/www/Application/Model/Server.php

    r78 r93  
    99  var $Task;
    1010 
    11   function __construct($Database, $Id)
    12   {
    13     $this->Database = $Database;
    14     $this->Task = new Task($Database);
     11  function __construct($System, $Id)
     12  {
     13    parent::__construct($System);
     14    $this->Task = new Task($System);
    1515    $this->Id = $Id;
    1616    $DbResult = $this->Database->query('SELECT * FROM `Server` WHERE `Id`='.$Id);
     
    6868  function GetState()
    6969  {
    70     global $System;
    71    
    7270    $State = array();
    73     $State['RealmdPortState'] = $System->NetworkPortState('localhost', $this->Server['NetworkPortRealmd']);
     71    $State['RealmdPortState'] = $this->System->NetworkPortState('localhost', $this->Server['NetworkPortRealmd']);
    7472    $State['Online'] = $State['RealmdPortState'];
    7573    $DbResult = $this->Database->query('SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA = "server'.$this->Id.'_realmd"');
     
    9795  function UpdateRealmlist()
    9896  {
    99     global $Config;
    100    
    10197    $this->Database->query('TRUNCATE TABLE server'.$this->Id.'_realmd.realmlist');
    10298    $DbResult = $this->Database->select('Realm', '*', 'Server = '.$this->Id);
    10399    while($Realm = $DbResult->fetch_assoc())
    104100    {
    105       $this->Database->insert('server'.$this->Id.'_realmd`.`realmlist', array('id' => $Realm['Id'], 'name' => addslashes($Realm['Name']), 'address' => $Config['Web']['Host'], 'port' => $Realm['NetworkPortWorldd'], 'icon' => 0, 'timezone' => 1, 'color' => 0));
     101      $this->Database->insert('server'.$this->Id.'_realmd`.`realmlist',
     102        array('id' => $Realm['Id'], 'name' => addslashes($Realm['Name']),
     103        'address' => $this->Config['Web']['Host'], 'port' => $Realm['NetworkPortWorldd'],
     104        'icon' => 0, 'timezone' => 1, 'color' => 0));
    106105    }
    107106  }
     
    116115  function UpdateScripts()
    117116  {
    118     global $Config;
    119    
    120117    $ServerBinDir = '../server/'.$this->Id.'/bin/';
    121118    if(!file_exists($ServerBinDir)) mkdir($ServerBinDir, 0777, true);       
     
    147144  function SetupConfigurationFiles()
    148145  {
    149     global $Config;
    150    
    151146    $EmulatorEtcDir = '../emulator/'.$this->Server['Database']['Emulator']['Id'].'/etc/';
    152147    $ServerEtcDir = '../server/'.$this->Id.'/etc/';
     
    156151   
    157152    // realmd.conf
    158     $EmulatorConfig = new MangosConfigurationFile($this->Database);
     153    $EmulatorConfig = new MangosConfigurationFile($this->System);
    159154    $EmulatorConfig->Load($EmulatorEtcDir.'realmd.conf.dist');
    160155    $EmulatorConfig->ParameterList['LoginDatabaseInfo'] = 'localhost;3306;server'.$this->Id.';server'.$this->Id.';server'.$this->Id.'_realmd';
     
    178173    while($DbRow = $DbResult->fetch_assoc())
    179174    {
    180       $Server = new Server($this->Database, $DbRow['Id']);
     175      $Server = new Server($this->System, $DbRow['Id']);
    181176      $Server->UpdateState();
    182177    }   
     
    249244    if($DoBackup)
    250245    {
    251       $Backup = new Backup($this->Database, 0);
     246      $Backup = new Backup($this->System, 0);
    252247      $Output .= '<br />'.$Backup->Create($this->Id);
    253248    }
     
    308303    while($DbRow = $DbResult->fetch_assoc())
    309304    {
    310       $Realm = new Realm($this->Database, $DbRow['Id']);
     305      $Realm = new Realm($this->System, $DbRow['Id']);
    311306      $UsedMemory += $Realm->GetUsedMemory();
    312307    }
     
    335330  function UpdateRealmlistAccountCount()
    336331  {
    337     global $Config;
    338    
    339332    $this->Database->query('TRUNCATE TABLE server'.$this->Id.'_realmd.realmcharacters');
    340333    $DbResult = $this->Database->select('Realm', '*', 'Server = '.$this->Id);
     
    345338  }
    346339}
    347 
    348 ?>
  • trunk/www/Application/Model/ServerList.php

    r78 r93  
    1313
    1414}
    15 
    16 ?>
  • trunk/www/Application/Model/Shell.php

    r78 r93  
    77  var $Database;
    88 
    9   function __construct($Database)
     9  function __construct($System)
    1010  {
    11     $this->Database = $Database
     11    parent::__construct($System)
    1212  }
    1313 
     
    1717    while($Server = $DbResult->fetch_assoc())
    1818    {
    19       $History = new History($this->Database, $Server['Id'], 1);
    20       $Server = new Server($this->Database, $Server['Id']);
     19      $History = new History($this->System, $Server['Id'], 1);
     20      $Server = new Server($this->System, $Server['Id']);
    2121      $History->AddValue($Server->GetUsedMemory());
    2222    }   
    2323  }
    2424
     25  function Show()
     26  {
     27    $Output = '';
     28    if(count($_SERVER['argv']) > 1)
     29    {
     30      $Command = $_SERVER['argv'][1];
     31      if($Command == 'ServerProcessLog')
     32      {
     33        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
     34        {
     35          $MangosDebug = new MangosDebug($this->System);
     36          $Output = $MangosDebug->ProcessLog($_SERVER['argv'][2]);
     37        } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.';
     38      } else
     39      if($Command == 'ServerLock')
     40      {
     41        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
     42        {
     43          $Server = new Server($this->System, $_SERVER['argv'][2]);
     44          $Server->Lock();
     45        } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.';
     46      } else 
    2547      if($Command == 'ServerUnLock')
    2648      {
    2749        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    2850        {
    29           $Server = new Server($this->Database, $_SERVER['argv'][2]);
     51          $Server = new Server($this->System, $_SERVER['argv'][2]);
    3052          $Server->UnLock();
    3153        } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.';
     
    3557        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    3658        {
    37           $Realm = new Realm($this->Database, $_SERVER['argv'][2]);
     59          $Realm = new Realm($this->System, $_SERVER['argv'][2]);
    3860          $Realm->Lock();
    3961        } else $Output = 'Jako druhý parameter je nutno zadat Id světa.';
     
    4365        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    4466        {
    45           $Realm = new Realm($this->Database, $_SERVER['argv'][2]);
     67          $Realm = new Realm($this->System, $_SERVER['argv'][2]);
    4668          $Realm->UnLock();
    4769        } else $Output = 'Jako druhý parameter je nutno zadat Id světa.';
     
    5173        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    5274        {
    53           $Emulator = new Emulator($this->Database, $_SERVER['argv'][2]);
     75          $Emulator = new Emulator($this->System, $_SERVER['argv'][2]);
    5476          $Emulator->Lock();
    5577        } else $Output = 'Jako druhý parameter je nutno zadat Id emulátoru.';
     
    5981        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    6082        {
    61           $Emulator = new Emulator($this->Database, $_SERVER['argv'][2]);
     83          $Emulator = new Emulator($this->System, $_SERVER['argv'][2]);
    6284          $Emulator->UnLock();
    6385        } else $Output = 'Jako druhý parameter je nutno zadat Id emulátoru.';
     
    6789        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    6890        {
    69           $Backup = new Backup($this->Database, $_SERVER['argv'][2]);
     91          $Backup = new Backup($this->System, $_SERVER['argv'][2]);
    7092          $Backup->Lock();
    7193        } else $Output = 'Jako druhý parameter je nutno zadat Id zálohy.';
     
    7597        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    7698        {
    77           $Backup = new Backup($this->Database, $_SERVER['argv'][2]);
     99          $Backup = new Backup($this->System, $_SERVER['argv'][2]);
    78100          $Backup->UnLock();
    79101        } else $Output = 'Jako druhý parameter je nutno zadat Id zálohy.';
     
    81103      if($Command == 'TaskProcess')
    82104      {
    83         $Task = new Task($this->Database);
     105        $Task = new Task($this->System);
    84106        $Task->ProcessAllCycle();
    85107      } else
     
    90112        while($DbRow = $DbResult->fetch_assoc())
    91113        {
    92           $Server = new Server($this->Database, $DbRow['Id']);
    93           $System->Modules['User']->User['Id'] = $Server->Server['User'];
     114          $Server = new Server($this->System, $DbRow['Id']);
     115          $this->System->Modules['User']->User['Id'] = $Server->Server['User'];
    94116          $Server->Start();
    95117        }
     
    98120        while($DbRow = $DbResult->fetch_assoc())
    99121        {
    100           $Realm = new Realm($this->Database, $DbRow['Id']);
    101           $System->Modules['User']->User['Id'] = $Realm->Data['User'];
     122          $Realm = new Realm($this->System, $DbRow['Id']);
     123          $this->System->Modules['User']->User['Id'] = $Realm->Data['User'];
    102124          $Realm->Start();
    103125        }
     
    106128      {
    107129        // Servers
    108         $Backup = new Backup($this->Database, 0);
     130        $Backup = new Backup($this->System, 0);
    109131        $DbResult = $this->Database->select('Server', 'Id, User');
    110132        while($DbRow = $DbResult->fetch_assoc())
    111133        {
    112           $System->Modules['User']->User['Id'] = $DbRow['User'];
     134          $this->System->Modules['User']->User['Id'] = $DbRow['User'];
    113135          $Backup->Create($DbRow['Id']);
    114136        }
     
    118140        if((count($_SERVER['argv']) > 2) and is_numeric($_SERVER['argv'][2]))
    119141        {
    120           $Server = new Server($this->Database, $_SERVER['argv'][2]);
     142          $Server = new Server($this->System, $_SERVER['argv'][2]);
    121143          $Server->ProcessLog();
    122144        } else $Output = 'Jako druhý parameter je nutno zadat Id serveru.';
     
    128150      if($Command == 'UpdateState')
    129151      {
    130         $Realm = new Realm($this->Database, 0);
     152        $Realm = new Realm($this->System, 0);
    131153        $Realm->UpdateStateAll();
    132         $Server = new Server($this->Database, 0);
     154        $Server = new Server($this->System, 0);
    133155        $Server->UpdateStateAll();
    134156      } else
     
    137159        if((count($_SERVER['argv']) > 3) and is_numeric($_SERVER['argv'][2]) and is_numeric($_SERVER['argv'][3]))
    138160        {
    139           $Server = new Server($this->Database, $_SERVER['argv'][2]);
     161          $Server = new Server($this->System, $_SERVER['argv'][2]);
    140162          $Server->ChangeDatabaseId($_SERVER['argv'][3]);
    141163        } else $Output = 'Jako druhý parameter je nutno zadat Id serveru, jako třetí Id databáze.';
     
    145167        if((count($_SERVER['argv']) > 3) and is_numeric($_SERVER['argv'][2]) and is_numeric($_SERVER['argv'][3]))
    146168        {
    147           $Realm = new Realm($this->Database, $_SERVER['argv'][2]);
     169          $Realm = new Realm($this->System, $_SERVER['argv'][2]);
    148170          $Realm->ChangeDatabaseId($_SERVER['argv'][3]);
    149171        } else $Output = 'Jako druhý parameter je nutno zadat Id světa, jako třetí Id databáze.';
     
    154176  }
    155177}
    156 
    157 ?>
  • trunk/www/Application/Model/TableRelations.php

    r69 r93  
    6363 
    6464);
    65 
    66 ?>
  • trunk/www/Application/Model/Task.php

    r78 r93  
    77  var $TempScript = 'temp/wowhosting_script.sh';
    88 
    9   function __construct($Database)
     9  function __construct($System)
    1010  {
    11     $this->Database = $Database;
     11        parent::__construct($System);   
    1212  }
    1313 
    1414  function Add($Title, $Task)
    1515  {
    16     global $System;
    17    
    1816    $CommandList = implode("\n", $Task)."\n";
    19     $this->Database->insert('Task', array('User' => $System->Modules['User']->User['Id'], 'Title' => $Title, 'TimeCreate' => 'NOW()', 'CommandList' => $CommandList));
     17    $this->Database->insert('Task', array('User' => $this->System->Modules['User']->User['Id'], 'Title' => $Title, 'TimeCreate' => 'NOW()', 'CommandList' => $CommandList));
    2018  }
    2119
    2220  function ProcessAll()
    2321  {
    24     global $Config;
    25    
    26     chdir($Config['BaseDir']);
     22    chdir($this->Config['BaseDir']);
    2723    $DbResult = $this->Database->query('SELECT * FROM Task WHERE State = 0 ORDER BY Id,TimeCreate ASC');
    2824    while($Task = $DbResult->fetch_assoc())
     
    5955  }
    6056}
    61 
    62 ?>
  • trunk/www/Application/Model/User.php

    r80 r93  
    5757  function Register($Login, $Password, $Password2, $Email, $Name)
    5858  {
    59     global $Options, $Config;
    60 
    6159    if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '')  || ($Name == '')) $Result = $this->System->Translate('MissingData');
    6260    else if($Password != $Password2) $Result = $this->System->Translate('PasswordsUnmatched');
     
    154152      $Mail = new Mail();
    155153      $Mail->Subject = 'Obnova hesla';
    156       $Mail->Content = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'">http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder']."</a>.<br />\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".$Row['Login']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte.";
     154      $Mail->Content = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.
     155        $this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].'">http://'.
     156        $this->Config['Web']['Host'].$this->Config['Web']['RootFolder']."</a>.<br />\n".
     157        "Pokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".
     158        $Row['Login']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".
     159        '<a href="http://'.$this->Config['Web']['Host'].$this->Config['Web']['RootFolder'].
     160        '/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.
     161        $NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n".
     162        "<br><br>Na tento email neodpovídejte.";
    157163      $Mail->RecipientName = $Row['Name'];
    158164      $Mail->RecipientAddress = $Row['Email'];
     
    184190  }
    185191}
    186 
    187 ?>
Note: See TracChangeset for help on using the changeset viewer.