Add infos into target window
[ryzomcore.git] / ryzom / server / www / login / libs / r2_login_domain.php
blob489020eae0fe30ce5ec02a80b78b9c5c7c468498
1 <?php
3 class ServerDomain {
5 function __construct($db, $clientApplication) {
6 $this->db = $db;
7 $this->db->select();
8 $this->domainInfo = $this->db->querySingle('SELECT * FROM domain WHERE domain_name = "'._e($clientApplication).'"');
9 if (!$this->domainInfo)
10 die('Can\'t find row for domain '.$clientApplication);
11 $this->id = $this->domainInfo['domain_id'];
12 $this->shardInfo = $this->db->querySingle('SELECT * FROM shard WHERE domain_id = "'.$this->id.'"');
13 if (!$this->shardInfo)
14 die('Can\'t find row for shard '.$clientApplication);
15 $this->domainInfo['shard'] = $this->shardInfo;
16 return $this->domainInfo;
19 function get($info) {
20 return $this->domainInfo[$info];
23 function getShard($info) {
24 return $this->domainInfo['shard'][$info];
27 function checkStatus($status, $User) {
28 $error = '';
30 if ($status == 'ds_close')
31 $error = '0:Reboot sequence...';
32 else if ($status == 'ds_dev' && strstr($User->priv, ':DEV:') == false)
33 $error = '0:You are not allowed to connect now, retry later';
34 else if ($status == 'ds_restricted') {
35 if ( strstr($User->priv, ':DEV:') == false
36 && strstr($User->priv, ':SGM:') == false
37 && strstr($User->priv, ':GM:') == false
38 && strstr($User->priv, ':EM:') == false
39 && strstr($User->priv, ':EG:') == false
40 && strstr($User->priv, ':TEST:') == false
41 ) {
42 $error = '0: Reboot sequence...'."\n\n";
43 $error .= 'The server has been rebooted. The Ryzom Team are carefully inspecting the shard to get it ready for you.'."\n\n";
44 $error .= 'Le serveur a été redémarré. L\'équipe de Ryzom est en train de le vérifier méticuleusement et le prépare pour vous.'."\n\n";
45 $error .= 'Der Server wurde neu gestartet. Das Ryzom-Team führt eine ausführliche Überprüfung des Servers durch, um ihn für Dich vorzubereiten!'."\n\n";
46 $error .= 'El servidor va a reiniciar. El equipo de Ryzom está revisando suavemente el servidor y preparándolo para ti!'."\n\n";
50 if ($error) {
51 echo iconv('UTF-8', 'ISO-8859-1', $error);
52 die();