function login() { global $secteur, $page, $_path, $newsAmodifier, $array_adm; if ($page == 'login') { //Si l'id passé en paramètre dans l'url n'existe pas, c'est que le visiteur a été amenené ici par hasard if (!request_confirm('admin-login')) { //Donc on redirige vers index.php header('location:' . getenv('HTTP_REFERER')); //Puis on stoppe l'exécution du script exit; } debug_log('page login'); // si on s'identifie if (request_confirm('admin-login')) { debug_log('form login'); $login = request_post('pseudo'); $pass = request_post('password'); if (array_key_exists($login, $array_adm)) { debug_log('exists login' . "test({$pass} == " . $array_adm[$login] . ")"); if ($pass == $array_adm[$login]) { debug_log('pass login'); $_SESSION['admin'] = true; $_SESSION['user'] = $login; } else { $_SESSION['error'] = "Mot de passe erroné."; } } else { $_SESSION['error'] = "Cet accès n'existe pas."; } header('location:' . getenv('HTTP_REFERER')); } } }
/** * 发短信接口 * */ public function Sms($data) { $url = C('APIURL') . '/service/sms'; $appKey = C('APPKEY'); $appNO = C('APPNO'); $appID = C('APPID'); $asKey = C('ASKEY'); $result = ['userID' => $data['userID'], 'mobile' => $data['mobile'], 'time' => time(), 'appNO' => $appNO, 'appID' => $this->encrypt($appID, $appKey), 'business' => $data['business'], 'signType' => 'MD5', 'tplno' => $data['tplno'], 'uname' => $data['uname'], 'vcode' => $data['vcode'], 'host' => 'cyj.zhiyicx.com']; $result['sign'] = $this->genSign($result, $asKey); $response = request_post($url, $result); return $response; }
/** * 添加清洗保养品类 * @param object $cleanKind 清洗保养品类 * @return array */ public function addCleanKind($cleanKind) { $data = $cleanKind; $data['token'] = session('user_info.token'); $req_url = BASE_URL . ADD_CLEAN_KIND_URL; //\Think\Log::record($data['name']); try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } return $result; }
/** * 添加电器故障 * @param obj $trouble 故障对象 * @return array */ public function addTrouble($trouble) { $data['break_name'] = $trouble['break_name']; $data['appliance_id'] = $trouble['father_id']; $data['son_id'] = $trouble['son_id']; $data['token'] = session('user_info.token'); $req_url = BASE_URL . ADD_TROUBLE_URL; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } return $result; }
/** * 获取用户详情 * @param Int $customer_id 用户id * @return array */ public function getCustomerDetail($customer_id) { $data['user_id'] = $customer_id; //商户ID //分页单页显示行数 $data['token'] = session('user_info.token'); // API URL 管理员获取列表URL 与 商户获取列表URL $req_url = BASE_URL . GET_CUSTOMER_DETAIL_URL; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } $this->errorCode = $result['status']; $this->errorMessage = $result['message']; $detail = $result['data']; return $detail; }
/** * 替换用户绑定的同类型的第三方账号 */ 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']); } }
<?php if (verif_connect()) { load_css('guild.css', 'guild'); if (has_guild()) { if (has_guild_acces('recrutement')) { if (request_confirm('guild-engage') || request_confirm('guild-refuse')) { if (verifier_token(60, get_link('Recrutement', 'Guild'), 'guild-candidat-' . $_POST['Account_ID'])) { $Account_Query = get_db("candidat_guild_confirm", array('Guild_ID' => guild_data('Guild_ID'), 'Account_ID' => request_post('Account_ID'))); if (!empty($Account_Query)) { if (request_confirm('guild-engage')) { update_db('Caranille_Accounts', stripslashes_r($_POST)); $message = "Vous avez été accepté dans la guilde " . guild_data('Guild_Name') . "."; } else { update_db('Caranille_Accounts', array('Account_ID' => $Account_Query['Account_ID'], 'Account_Guild_ID' => 0, 'Account_Guild_Accept' => 0)); $message = "Votre candidature dans la guilde " . guild_data('Guild_Name') . " a été refusé."; } add_diary($message, $Account_Query['Account_ID']); insert_db('Caranille_Private_Messages', array('Private_Message_Transmitter' => logged_data('Account_ID'), 'Private_Message_Receiver' => $Account_Query['Account_Pseudo'], 'Private_Message_Subject' => "Votre candidature dans la guilde " . guild_data('Guild_Name'), 'Private_Message_Message' => $message, 'Private_Message_Conversation' => null)); } } } } } }
<?php //Si le joueur est dans une ville, on regarde si il est actuellement en combat if (verif_battle()) { if (request_confirm('End_Invocations')) { $Invocation_Choice = request_post('Invocation'); $MP_Choice = request_post('MP_Choice'); if (user_data('Account_MP_Remaining') >= $MP_Choice) { $Invocation = get_db("edit_admin", array('table' => 'Caranille_Invocations', 'ID' => 'Invocation_Name', 'value' => $Invocation_Choice)); $Invocation_Damage = $Invocation['Invocation_Damage']; $Total_Damage_Monster = getMonsterDamage(); // non utilisé ??? //$Monster_MIN_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) / $bonus_malus_battle; //$Monster_MAX_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) * $bonus_malus_battle; $Invocation_Total_Damage = htmlspecialchars(addslashes($Invocation_Damage)) * htmlspecialchars(addslashes($MP_Choice)); $_SESSION['Monster_HP'] = monster_data('HP') - htmlspecialchars(addslashes($Invocation_Total_Damage)); $message = "{$Invocation_Choice} a infligé {$Invocation_Total_Damage} HP de dégat au " . monster_data('Name') . "<br /><br />"; $message .= "Le " . monster_data('Name') . " vous a infligé {$Total_Damage_Monster} HP de dégat<br /><br />"; add_diary($message); } else { $message = 'Vous n\'avez pas assez de MP'; } $roaster_action = true; /** echo $message ; echo '<form method="POST" action="'.get_link('Battle','Game').'">'; echo '<input type="submit" name="Continue" value="continuer">'; echo '</form>'; **/ } }
public function bind_other() { file_put_contents('/tmp/test.log', 'bind_other' . "\n\r", FILE_APPEND); $phone = $this->data['phone']; //用户手机号 $uname = $this->data['uname']; //用户名 $sex = $this->data['sex']; //性别 $avatar_url = $this->data['avatar_url']; //用户头像 $avatar_width = $this->data['avatar_width']; //宽 $avatar_height = $this->data['avatar_height']; //高 $type = $this->data['type']; //类型 $type_uid = $this->data['type_uid']; //授权登陆用户名 $access_token = $this->data['access_token']; //授权账号 $access_token_secret = $this->data['access_token_secret']; //授权密码 //插入本地数据库信息 $syncdata['uid'] = $this->mid; $syncdata['type_uid'] = $type_uid; $syncdata['type'] = $type; $syncdata['oauth_token'] = $access_token; $syncdata['oauth_token_secret'] = $access_token_secret; $syncdata['is_sync'] = 0; if (!empty($type)) { //S ( 'user_login_' . $this->mid, null ); //去掉用户重新登录 //用手机号 第三方标识 判断他们之间的关系 $sCenter_token = $this->getCenterToken(); $sCtlgurl = C('APIURL') . '/v1/user/user-bind-info?_format=json&access_token=' . $sCenter_token; //echo $sCtlgurl; $rCtlg = array('mobile' => $phone, 'type' => $type, 'open_id' => $type_uid); $sCtlgstatus = request_post($sCtlgurl, $rCtlg); $rStatus = json_decode($sCtlgstatus, true); if ($rStatus['code'] === 1401) { //该手机绑定过 且与 当前第三方不同 return $this->returnData($rStatus['data']['ret'], '选择替换第三方帐号', 3); } else { if ($rStatus['code'] === 1301) { //该手机未绑定过 做绑定操作 //发送用户 头像昵称token 做绑定操作 $sCbindurl = C('APIURL') . '/v1/user/third-bind?_format=json&access_token=' . $sCenter_token; $rCthird = array('open_id' => $rStatus['data']['ret']['open_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 && M('login')->add($syncdata)) { //加入数据库 return $this->returnData('', '绑定成功', 1); } else { return $this->returnData('', '绑定失败', 2); } } else { if ($rStatus['code'] === 0) { //手机号和当前第三方已绑定,可直接登录 return $this->returnData(array('open_id' => $rStatus['data']['ret']['open_id']), '请直接登录!', 1); } else { return $this->returnData('', '操作异常,请重试!', 4); } } } } else { return $this->returnData('', '类型参数异常,请重试!', 4); } //返回信息说明,如果绑定多,data返回绑定过的参数,code=1,msg提示消息。如果没有绑定过,data返回空数组,code=0, // $data['avatar'];//用户头像 // $data['uname'] ;//用户头像 // $data['sex']; }
foreach ($_SESSION['CRAFT']['crafting'] as $craft) { insert_db('Caranille_Craftings', array('Crafting_Fragment_ID' => $craft, 'Crafting_Item_ID' => $id_item)); } } insert_db('Caranille_Inventory', array('Inventory_Account_ID' => user_data('Account_ID'), 'Inventory_Item_ID' => $id_item, 'Inventory_Item_Quantity' => 1, 'Inventory_Item_Equipped' => 'No')); unset($_SESSION['CRAFT']); } elseif (request_confirm('choose-name')) { // saisir un nom et valider les resultats // seulement si le craft contient les 5 element requis... if (request_confirm('item-frag')) { $_SESSION['CRAFT']['crafting'] = $_POST['item-frag']; foreach (request_post('item-frag') as $k => $_frag) { if ($k >= 0 && $k <= 4) { $frag = get_db("edit_admin", array('table' => 'Caranille_Fragments', 'ID' => 'Fragment_ID', 'value' => $_frag)); foreach ($array_character_type as $char) { if (isset($frag['Fragment_' . ucfirst($char) . '_Effect'])) { $_SESSION['CRAFT']['item']['Item_' . ucfirst($char) . '_Effect'] += stripslashes($frag['Fragment_' . ucfirst($char) . '_Effect']); } } } } } // 3 pieces et 2 bonus // sinon on invite à recommencer ou abandonner } elseif (request_confirm('select-frag')) { //print_r($_POST); $_SESSION['CRAFT']['item']['Item_Type'] = request_post('item-type'); $_SESSION['CRAFT']['item']['Item_Level_Required'] = user_data('Account_Level'); $Fragment_Query = list_db('craftable_list', array('Account_ID' => user_data('Account_ID'), "Item_Type" => $_SESSION['CRAFT']['item']['Item_Type'])); } }
{ $logged_in_user = user\get_logged_in_user(); $user_id = NULL; if ($logged_in_user) { $user_id = $logged_in_user['id']; } $trips = database\get_trips_near_on($data['route'], $data['departure'], $user_id); if ($trips == NULL) { $trips = array(); } $trips_found = array("trips" => $trips); functions\json_respond('OK', 'Searched!', $trips_found); } function request_post($data) { $logged_in_user = user\get_logged_in_user(); if (!$logged_in_user) { return functions\json_respond('ERROR', 'Login Required!'); } $request_data = array("user_id" => $logged_in_user['id'], "trip_id" => $data['trip_id'], "message" => $data['message']); if (database\request_ride($request_data)) { return functions\json_respond('OK', 'Request Sent!'); } else { return functions\json_respond('ERROR', 'Unable to request ride'); } } if ($_GET) { search_get(json_decode($_GET['data'], true)); } elseif ($_POST) { request_post(json_decode($_POST['data'], true)); }
echo '</td>'; echo '</tr>'; } } } echo "</table>"; echo '<p>'; echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>'; echo '</p>'; if (empty($Private_Message_ID)) { echo 'Vous n\'avez aucun nouveau message'; } } else { //Si l'utilisateur souhaite repondre à un message if (request_confirm('Reply')) { $Conversation = request_post('Private_Message_Conversation') == 0 ? request_post('Private_Message_ID') : request_post('Private_Message_Conversation'); $Receiver = htmlspecialchars(addslashes($_POST['Transmitter'])); $Message_Subject = htmlspecialchars(addslashes($_POST['Message_Subject'])); $Message = htmlspecialchars(addslashes($_POST['Message'])); echo LanguageValidation::iMsg("intro.message.reply"); echo formulaire_input(array(text_input("label.message.reply", "Receiver", $Receiver, null, null, "placeholder.message.reply", null, true), text_input("label.message.subject", "Message_Subject", "Re : {$Message_Subject}", null, null, "placeholder.message.subject", null, true), call_bbcode_editor("Message"), submit_input("Send", "btn.message.send")), "Mailbox-Send", get_link('Mailbox', 'User'), "post", null); echo bb_code($Message); } else { echo LanguageValidation::iMsg("intro.private.message"); echo '<p>'; echo '<a href="' . get_link('Mailbox', 'User', array("Write" => "mail")) . '">' . LanguageValidation::nMsg("btn.message.write") . '</a>'; echo ' - '; echo '<a href="' . get_link('Mailbox', 'User', array("Read" => "box")) . '">' . LanguageValidation::nMsg("btn.message.read") . '</a>'; echo '</p>'; } }
/** * 添加电器品类 * @param array $appliance_name 品类名称 * @param array $input_name 商户端图标控件 * @param array $input_name2 商户端小图标控件 * @param array $input_name3 用户端图标控件 * @param array $input_name4 用户端清洗保养图标控件 * @return array */ public function addAppliance($appliance_name, $father_id = null, $input_name = null, $input_name2 = null, $input_name3 = null, $input_name4 = null) { $data['name'] = $appliance_name; $data['father_id'] = $father_id; $data['big_logo'] = $input_name; $data['small_logo'] = $input_name2; $data['middle_logo'] = $input_name3; $data['middle2_logo'] = $input_name4; $data['token'] = session('user_info.token'); $req_url = BASE_URL . ADD_APPLIANCE_URL; //\Think\Log::record($data['name']); try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } return $result; }
<?php // l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil $title = "Historique"; $baseline = "vos actes passés"; load_css('corps.css', 'corps'); if (request_confirm('edit-role-play')) { if (verifier_token(600, get_link('diary', 'game'), "editor-role-play-" . request_post('Diary_ID'))) { update_db('Caranille_Diaries', array('Diary_Description' => request_post('roleplay'), 'Diary_ID' => request_post('Diary_ID'))); } } if (request_confirm('remove-role-play')) { if (verifier_token(600, get_link('diary', 'game'), "remover-role-play-" . request_post('Diary_ID'))) { delete_db('Caranille_Diaries', array('Diary_ID' => request_post('Diary_ID'))); } }
/** * 获取商户员工列表 * @param Int $mer_id 商户id * @return array */ public function getStaffList($mer_id = null) { $data['mer_id'] = $mer_id; $data['token'] = session('user_info.token'); $req_url = BASE_URL . GET_MER_STAFF_LIST; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } $this->errorCode = $result['status']; $this->errorMessage = $result['message']; $list = $result['data']; return $list; }
<?php //Si le joueur est dans une ville, on regarde si il est actuellement en combat if (verif_battle()) { if (request_confirm('End_Magics')) { if (user_data('Account_MP_Remaining') >= $Magic_MP_Cost) { $Magic_Choice = request_post('Magic'); $Magic_MP_Cost = request_post('Magic_MP_Cost'); $Magic = get_db("edit_admin", array('table' => 'Caranille_Magics', 'ID' => 'Magic_Name', 'value' => $Magic_Choice)); extract($Magic); $MIN_Magic = user_data('Level_Magic') / $bonus_malus_battle; $MAX_Magic = user_data('Level_Magic') * $bonus_malus_battle; $Remaining_MP = user_data('Account_MP_Remaining') - htmlspecialchars(addslashes($Magic_MP_Cost)); user_set('Account_MP_Remaining', $Remaining_MP); user_record(); if ($Magic_Type == "Attack") { $Negative_Magic_Damage_Player = getMonsterDefense(); //mt_rand($Monster_MIN_Defense, $Monster_MAX_Defense); $Positive_Magic_Damage_Player = mt_rand($MIN_Magic, $MAX_Magic) + $Magic_Effect; $Player_Total_Magic_Damage = htmlspecialchars(addslashes($Positive_Magic_Damage_Player)) - htmlspecialchars(addslashes($Negative_Magic_Damage_Player)); if ($Player_Total_Magic_Damage <= 0) { $Player_Total_Magic_Damage = 0; } $_SESSION['Monster_HP'] = monster_data('HP') - htmlspecialchars(addslashes($Player_Total_Magic_Damage)); $message = "{$Magic_Choice} a infligé {$Player_Total_Magic_Damage} HP de dégat au " . monster_data('Name') . "<br /><br />"; add_diary($message); } elseif ($Magic_Type == "Health") { //non utilisé ??? //$Monster_MIN_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) / $bonus_malus_battle; //$Monster_MAX_Defense = htmlspecialchars(addslashes($_SESSION['Monster_Defense'])) * $bonus_malus_battle; $Player_Health = mt_rand($MIN_Magic, $MAX_Magic) + $Magic_Effect;
/** * 删除销售商 * @param array $saleor_id 销售商ID * @return array */ public function delSaleor($saleor_id) { $data['saleor_id'] = $saleor_id; $data['token'] = session('user_info.token'); $req_url = BASE_URL . DEL_SALES_URL; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } return $result; }
function temoignages_exec() { global $secteur, $page, $_path, $temoignage_delimit, $temoignage_ipvisiteur, $temoignage_validForm, $temoignage_message, $temoignage_nom, $temoignage_mail, $temoignage_MsgErreur, $temoignage_file; if ($page == 'temoignages') { // --------------------- // GUESTBOOK $temoignage_file = $_path . 'livredor.txt'; $temoignage_delimit = '-*-'; // délimiteur // --------------------- // IP du visiteur / date $temoignage_ipvisiteur = $_SERVER["REMOTE_ADDR"]; $date = date("d/m/Y H:i:s"); // --------------------- // Initialisation $temoignage_nom = ''; $temoignage_message = ''; $temoignage_mail = ''; $temoignage_validForm = true; $temoignage_MsgErreur = ''; // --------------------- // TRAITEMENT SI formulaire soumis if (request_confirm('LivredorSubmit')) { if (verifier_token(600, get_link('temoignages', 'Install'), 'Temoignage-Send')) { // --------------------- // RECUPERATION des DONNEES //On convertit les caracteres html $temoignage_nom = request_post('nom'); $temoignage_mail = request_post('mail'); // textarea :attention aux injections de code html ! $allowable_tags = '<b><a>'; // (facultatif) on autorise ces balises $temoignage_message = request_post('message'); $temoignage_message = strip_tags($temoignage_message, $allowable_tags); $temoignage_message = nl2br($temoignage_message); // nl2br() : change les sauts de ligne tapés par le visiteur en <br /> $temoignage_message = preg_replace("/(\r\n|\n|\r)/", " ", $temoignage_message); // enlève les sauts de ligne résiduels, pour l'écriture dans le fichier (sur une seule ligne) // On censure $newnom = censorWords($temoignage_nom); $newmessage = censorWords($temoignage_message); $newmail = censorWords($temoignage_mail); $champ_censure = array(); if ($temoignage_nom != $newnom) { $champ_censure[] = 'Nom'; } if ($temoignage_message != $newmessage) { $champ_censure[] = 'Message'; } if ($temoignage_mail != $newmail) { $champ_censure[] = 'Email'; } if (count($champ_censure) > 0) { $temoignage_MsgErreur .= 'Ces champs ont été censurés : ' . implode(', ', $champ_censure) . '<br />'; } // champs obligatoires $champ_obligatoire = array(); if ($temoignage_nom == '' || $newnom == '') { $temoignage_validForm = false; $champ_obligatoire[] = 'Nom'; } if ($temoignage_message == '' || $newmessage == '') { $temoignage_validForm = false; $champ_obligatoire[] = 'Message'; } if (count($champ_obligatoire) > 0) { $temoignage_MsgErreur .= 'Remplissez tous les champs obligatoires : ' . implode(', ', $champ_obligatoire) . '<br />'; } // ----------------------- // Vérification du format de l'Email if ($temoignage_mail != '' && !filter_var($temoignage_mail, FILTER_VALIDATE_EMAIL)) { $temoignage_validForm = false; $temoignage_MsgErreur .= 'Invalide Email !<br />'; } // ----------------------- // OK SI PAS D'ERREUR if ($temoignage_validForm === true) { // --------------------- if ($newnom != '' && $newmessage != '') { // ECRITURE dans le GESTBOOK //Ouverture du fichier en écriture $fp = fopen($temoignage_file, 'a'); // 'a' : à la fin du fichier $line = $newnom . $temoignage_delimit . $newmessage . $temoignage_delimit . $newmail . $temoignage_delimit . $date . $temoignage_delimit . $temoignage_ipvisiteur . "\n"; //On rajoute le message fwrite($fp, $line, strlen($line)); //fermeture du fichier fclose($fp); // --------------------- } // --------------------- // On vide $temoignage_nom = ''; $temoignage_message = ''; $temoignage_mail = ''; } } } // --------------------- //unset($_POST); // anti-F5 (évite de re-poster le formulaire en cas de F5 ("Actualiser la page") //$_SESSION['antiF5'] = rand(100000,999999); // --------------------- load_css('goldbook.css', 'goldbook'); load_js('goldbook.js', 'goldbook'); } }
/** * 添加电器品类 * @param array $appliance_name 品类名称 * @param array $input_name 商户端图标控件 * @param array $input_name2 商户端小图标控件 * @param array $input_name3 用户端图标控件 * @return array */ public function addBrand($brand_name, $brand_url = null) { $data['brand_name'] = $brand_name; $data['brand_url'] = $brand_url; $data['token'] = session('user_info.token'); $req_url = BASE_URL . ADD_BRAND_URL; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } return $result; }
<?php // l'utilisateur peut ajouter un titre pour chaque module different de Caranille -Accueil //$title =""; $baseline = "Bienvenue dans le champ de bataille"; include_once "Battle/Index.php"; //(path_source("Index","Battle","Battle")); if (verif_connect()) { if (has_order()) { if (request_confirm('Launch_Battle')) { $Account = get_db("battle_account", array('Account_ID' => request_post('Account_ID'))); if (!empty($Account)) { init_battle('Account', $Account, 'Arena'); } } } }
<?php if (verif_access("Modo")) { if (request_confirm('Add')) { if (request_confirm('Account_Reason') && request_confirm('Account_ID')) { $sanction['Account_Status'] = "Banned"; $sanction['Account_Reason'] = request_post('Account_Reason'); $sanction['Account_ID'] = request_post('Account_ID'); insert_db('Caranille_Accounts', $sanction); echo 'Sanctions ajoutée'; } else { echo 'Tous les champs n\'ont pas été remplis'; } } }
/** * 同意商户认证 * @param Int $applyId 申请id * @param array $brandList 授权品牌列表 * @param array $reason 意见理由 * @return array */ public function agreeBrand($applyId, $brandList = null, $reason = null) { $data['apply_brand_id'] = $applyId; $data['brand_id'] = $brandList; //申请ID //分页单页显示行数 $data['reason'] = $reason; $data['token'] = session('user_info.token'); //addErrorLog('BrandAuth','logic','agreeBrand',$brandList); // API URL 管理员获取列表URL 与 商户获取列表URL $req_url = BASE_URL . AGREE_BRAND_APPLY; try { $result = request_post($req_url, $data); $result = json_decode($result, true); } catch (\Exception $e) { print $e->getMessage(); exit; } $this->errorCode = $result['status']; $this->errorMessage = $result['message']; return $result; }
} else { $_return .= "erreur sur le token"; } } if (request_confirm('sent')) { //On déclare les variables $_return = ""; $signature_erreur = NULL; $avatar_erreur = NULL; $avatar_erreur1 = NULL; $avatar_erreur2 = NULL; $avatar_erreur3 = NULL; //Encore et toujours notre belle variable $i :p $i = 0; $temps = time(); $signature = request_post('signature'); //Vérification de la signature if (strlen($signature) > 200) { $signature_erreur = "Votre nouvelle signature est trop longue"; $i++; } else { user_set('Account_Signature', $signature); } //Vérification de l'avatar if (!empty($_FILES['avatar']['size'])) { //Liste des extensions valides $extensions_valides = array('jpg', 'jpeg', 'gif', 'png', 'bmp'); $e_av = false; if ($_FILES['avatar']['error'] > 0) { $avatar_erreur = "Erreur lors du tranfsert de l'avatar : "; $e_av = true;