Exemple #1
0
function create_config()
{
    if (request_confirm('Create_Configuration')) {
        extract($_POST);
        /**
         * update by Dimitri
         */
        $way = str_replace('index.php', '', getenv('SCRIPT_FILENAME'));
        $way = str_replace('Install/', '', $way);
        $url = get_url();
        // le principe fonctionne meme s'il n'y a pas de sous dossier
        // l'interet principale est de pouvoir utiliser des chemins absolus dans les liens ou dans les inclusions de fichiers
        $p_salt = uniqid(mt_rand(), true);
        $s_salt = uniqid(mt_rand(), true);
        if ($Open_Config = fopen("Config.php", "w")) {
            fwrite($Open_Config, "<?php\n\n        \t\t//Version du rpg de Caranille\n        \t\t\$version = \"4.8.0\";\n        \t\t\t\t\n        \t\t\$dns_host = '{$Driver}:host={$Server};dbname={$Database}';\n        \t\t\$dns_user = '******';\n        \t\t\$dns_pswd = '{$Password}';\n        \t\t\n        \t\t\$_path = \"{$way}\";\n        \t\t\$_url = \"{$url}\";\n        \t\t\n        \t\t\$prefixe_salt = \"{$p_salt}\";\n        \t\t\$suffixe_salt = \"{$s_salt}\";\n        \t\t\n        \t\tdate_default_timezone_set(\"{$Fuseaux}\");\n        \t\t\n        \t\tsetlocale(LC_ALL, \"{$Locale}\");\n\t\t\n            ?>");
            fclose($Open_Config);
            return true;
        }
    }
    if (request_confirm('step') && request_get('step') === 2) {
        return true;
    }
}
Exemple #2
0
     $arr_bank_holidays[] = $easter + 86400;
     // Paques
     $arr_bank_holidays[] = $easter + 86400 * 39;
     // Ascension
     $arr_bank_holidays[] = $easter + 86400 * 50;
     // Pentecote
     return $arr_bank_holidays;
 }
 if (request_confirm('End_Add_Event')) {
     insert_db('Caranille_Events', $_POST);
 }
 if (request_confirm('End_Edit_Event')) {
     update_db('Caranille_Events', $_POST);
 }
 $month = request_confirm('m') ? str_pad(request_get('m'), 2, "0", STR_PAD_LEFT) : date('m');
 $year = request_confirm('y') ? str_pad(request_get('y'), 4, "0", STR_PAD_LEFT) : date('Y');
 debug_log("period({$year},{$month})");
 $calendar = get_months($year, $month);
 foreach ($calendar as $day => $week) {
     $events[$day] = get_db('request_event', array('date' => "{$year}-{$month}-{$day}%", 'guild' => guild_data('Guild_ID')));
 }
 /**
 	$list_events = list_db('list_event',array(
 			'date' => "$year-$month%",
 			'guild' => guild_data('Guild_ID')
 		));
 **/
 $pm = intval($month) == 1 ? 12 : $month - 1;
 $nm = intval($month) == 12 ? 1 : $month + 1;
 $py = intval($month) == 1 ? $year - 1 : $year;
 $ny = intval($month) == 12 ? $year + 1 : $year;
 /**
  * 获取数据中心的token
  * @auther <*****@*****.**>
  *
  * @return str
  * */
 public function getCenterToken()
 {
     //清除session
     if ($_GET['clean'] == '1') {
         session('ucenter_token', NULL);
         //设置sessionu
         session('ucenter_outtime', NULL);
         //设置sessionu
     }
     if (session('?ucenter_token') && strtotime(session('ucenter_outtime')) > time()) {
         $sToken = session('ucenter_token');
     } else {
         $sCenurl = C('APIURL') . '/v1/token?_format=json&app_id=' . C('APPID') . '&app_key=' . C('APPKEY');
         $sJstoken = request_get($sCenurl);
         $rArr = json_decode($sJstoken, true);
         $sToken = $rArr['data']['ret']['access_token'];
         $nOuttime = $rArr['data']['ret']['expires'];
         session('ucenter_token', $sToken);
         //设置sessionu
         session('ucenter_outtime', $nOuttime);
         //设置sessionu
     }
     return $sToken;
 }
Exemple #4
0
<?php

load_css('forum.css', 'forum');
if (verif_connect()) {
    //Si l'utilisateur ne possède pas de Guilde
    if (has_guild()) {
        $titre = "Voir un sujet";
        //On récupère la valeur de t
        $Topic_ID = intval(request_get('t'));
        //Nombre de pages
        $numpage = request_confirm('page') ? intval(request_get('page')) : 1;
        //A partir d'ici, on va compter le nombre de messages pour n'afficher que les 15 premiers
        $query = get_db('request_guild_topic', array('topic' => $Topic_ID, 'Guild_ID' => guild_data('Guild_ID')));
        extract(stripslashes_r($query));
        //On ajoute 1 au nombre de visites de ce topic
        update_db('Caranille_Topics', array('Topic_ID' => $Topic_ID, 'Topic_Vu' => $Topic_Vu + 1));
        $Forum_ID = $Forum_ID;
        $baseline = '<i>Vous êtes ici</i> : 
			<a href="' . get_link('Main', 'Guild') . '">Index du forum</a> &raquo;
			<a href="' . get_link('Forum', 'Guild', array('f' => $Forum_ID)) . '">' . $Forum_Name . '</a> &raquo; 
			<a href="' . get_link('Topic', 'Guild', array('t' => $Topic_ID)) . '">' . $Topic_Titre . '</a>';
    }
}
Exemple #5
0
<?php

$membre = intval(request_get('m'));
$Resultat = list_db('public_diary_list', array('Account_ID' => $membre));
$query = get_db('account_forum', array('membre' => $membre));
extract($query);
 /**
  * 替换用户绑定的同类型的第三方账号
  */
 public function changeOauth()
 {
     file_put_contents('/tmp/test.log', 'changeOauth' . "\n\r", FILE_APPEND);
     $phone = $this->data['phone'];
     //用户手机号
     $uname = $this->data['uname'];
     //用户名
     $sex = $this->data['sex'];
     //性别
     $avatar_url = $this->data['avatar_url'];
     //用户头像
     $type = $this->data['type'];
     //类型
     $type_uid = $this->data['type_uid'];
     //第三方uid
     $oauth_token = $this->data['oauth_token'];
     //授权账号
     $oauth_token_secret = $this->data['oauth_token_secret'];
     //授权密码
     if (empty($phone) || empty($type_uid) || empty($type)) {
         $this->error('参数异常,请重新操作');
     }
     //发送用户 头像昵称token 做绑定操作
     $sCenter_token = $this->getCenterToken();
     $sCkurl = C('APIURL') . '/v1/user/mobile-sole?access_token=' . $sCenter_token . '&mobile=' . $phone;
     $sJson = request_get($sCkurl);
     $rResult = json_decode($sJson, true);
     // code=0 该手机号未被注册
     if ($rResult['code'] === 0) {
         $this->error($rResult['data']['msg']);
     }
     $map['cyj_id'] = $rResult['data']['ret']['open_id'];
     $sCbindurl = C('APIURL') . '/v1/user/third-bind?_format=json&access_token=' . $sCenter_token;
     $map['is_audit'] = 1;
     $map['is_active'] = 1;
     $map['is_init'] = 1;
     $map['phone'] = $phone;
     $userInfo = M('user')->where($map)->field('cyj_id,uid')->find();
     $rCthird = array('open_id' => $userInfo['cyj_id'], 'type' => $type, 'userAttributes' => json_encode(array('open_id' => $type_uid)), 'userInfo' => json_encode(array('nickname' => $uname, 'avatar' => $avatar_url, 'gender' => $sex)));
     $sCbind = request_post($sCbindurl, $rCthird);
     $rSetb = json_decode($sCbind, true);
     if ($rSetb['code'] == 0) {
         $saveData['type_uid'] = $type_uid;
         $saveData['oauth_token'] = $oauth_token;
         $saveData['oauth_token_secret'] = $oauth_token_secret;
         $where = array();
         $where['uid'] = array('eq', $userInfo['uid']);
         $where['type'] = array('eq', $type);
         M('login')->where($where)->save($saveData);
         $this->success('替换成功');
     } else {
         $this->error($rSetb['data']['msg']);
     }
 }
Exemple #7
0
function step_6()
{
    if (request_confirm('Configure') || request_confirm('step') && request_get('step') === 4) {
        install_edit_step_record(4);
        ?>
		Dernière étape avant de pouvoir commencer votre MMORPG<p>
		Cette étape est l'une des plus importantes pour votre jeu<br />
		C'est ici que vous allez devoir donner un nom à votre MMORPG ainsi que une courte introduction<br /><br />
		
		De plus vous allez créer votre propre compte qui sera le compte administrateur</p>
		
		<form method="POST" action="<?php 
        echo get_link("Install");
        ?>
">
		Nom de votre MMORPG<br /> <input type="text" name="MMORPG_Name"><br /><br />
		Présentation<br /><textarea name="Presentation" ID="Presentation" rows="10" cols="50"></textarea><br /><br />
		Pseudo<br /> <input type="text" name="Pseudo"><br /><br />
		Mot de passe<br /> <input type="password" name="Password"><br /><br />
		Confirmer le mot de passe<br /> <input type="password" name="Password_Confirm"><br /><br />
		Adresse e-mail<br /> <input type="text" name="Email"><br /><br />
		<input type="submit" name="Finish" value="Terminer">
		</form>
		<?php 
    }
}
Exemple #8
0
    $r = "SELECT Forum_Name, Auth_View, Auth_Post, Auth_Topic, Auth_Annonce, Auth_Modo\n    FROM Caranille_Forums WHERE Forum_ID ='{$forum}' limit 1; ";
    $query = get_db($r);
    //echo $r ;
    extract(stripslashes_r($query));
    $baseline = '<p><i>Vous êtes ici</i> : 
	<a href="' . get_link('Main', 'Forum') . '">Index du forum</a> &raquo;
    <a href="' . get_link('Forum', 'Forum', array('f' => $forum)) . '">' . $Forum_Name . '</a> &raquo; Nouveau topic</p>';
} elseif (request_confirm('t')) {
    $topic = intval(request_get('t'));
    $r = "SELECT Topic_Titre, f.Forum_ID,\n    Forum_Name, Auth_View, Auth_Post, Auth_Topic, Auth_Annonce, Auth_Modo\n    FROM Caranille_Topics t\n    LEFT JOIN Caranille_Forums f ON f.Forum_ID = t.Topic_Forum_id\n    WHERE Topic_ID ='{$topic}' limit 1; ";
    $query = get_db($r);
    //echo $r ;
    extract(stripslashes_r($query));
    $forum = $Forum_ID;
    $baseline = '<p><i>Vous êtes ici</i> : 
	<a href="' . get_link('Main', 'Forum') . '">Index du forum</a> &rarr; 
    <a href="' . get_link('Forum', 'Forum', array('f' => $forum)) . '">' . $Forum_Name . '</a> &raquo; 
	<a href="' . get_link('Topic', 'Forum', array('t' => $topic)) . '">' . $Topic_Titre . '</a> &raquo; Répondre</p>';
} elseif (request_confirm('p')) {
    $post = intval(request_get('p'));
    $r = "SELECT Post_Createur, t.Topic_ID, Topic_Titre, f.Forum_ID, Post_Texte,\n    Forum_Name, Auth_View, Auth_Post, Auth_Topic, Auth_Annonce, Auth_Modo\n    FROM Caranille_Posts p\n    LEFT JOIN Caranille_Topics t ON t.Topic_ID = p.Post_Topic_id\n    LEFT JOIN Caranille_Forums f ON f.Forum_ID = t.Topic_Forum_id\n    WHERE p.Post_id ='{$post}' limit 1; ";
    //echo $r;
    $query = get_db($r);
    extract(stripslashes_r($query));
    $topic = $Topic_ID;
    $forum = $Forum_ID;
    $baseline = '<p><i>Vous êtes ici</i> : 
	<a href="' . get_link('Main', 'Forum') . '">Index du forum</a> &raquo;
    <a href="' . get_link('Forum', 'Forum', array('f' => $forum)) . '">' . $Forum_Name . '</a> &raquo;
	<a href="' . get_link('Topic', 'Forum', array('t' => $topic)) . '">' . $Topic_Titre . '</a> &raquo; Modérer un message</p>';
}
Exemple #9
0
function download()
{
    global $secteur, $page;
    if ($page == 'download') {
        $version = request_get('version');
        print_r($_GET);
        $zipname = "http://www.caranille.fr/caranille159/Caranille_" . $version . ".zip";
        echo $zipname;
        $AgetHeaders = @get_headers($zipname);
        print_r($AgetHeaders);
        if (preg_match("|200|", $AgetHeaders[0])) {
            // file exists
            echo "file_exists..";
            if ($handle = fopen($zipname, 'r')) {
                echo "download...";
                header('Content-Type: application/zip');
                header('Content-disposition: attachment; filename=Caranille-' . $version . '.zip');
                header('Content-Length: ' . filesize($zipname));
                while (!feof($handle)) {
                    echo fread($handle, 4096);
                    flush();
                }
                fclose($handle);
            }
        }
        die;
    }
}
Exemple #10
0
<?php

// l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil
$title = "Amis";
$baseline = LanguageValidation::iMsg("welcome.user.friends.list");
//"";
if (verif_connect()) {
    if (request_confirm('add')) {
        $Account_ID = intval(request_get('add'));
        if ($Account_ID > 0) {
            insert_db('Caranille_Friends', array('Friend_Request' => logged_data('Account_ID'), 'Friend_Answer' => $Account_ID));
        }
    }
    if (request_confirm('del')) {
        $Account_ID = intval(request_get('del'));
        if ($Account_ID > 0) {
            delete_db('Caranille_Friends', array('Friend_Request' => logged_data('Account_ID'), 'Friend_Answer' => $Account_ID));
            delete_db('Caranille_Friends', array('Friend_Answer' => logged_data('Account_ID'), 'Friend_Request' => $Account_ID));
        }
    }
    $Player_List = list_db('list_account_friends', array('Account_ID' => logged_data('Account_ID')));
}