当前位置: 首页>>代码示例>>PHP>>正文


PHP base64url_encode函数代码示例

本文整理汇总了PHP中base64url_encode函数的典型用法代码示例。如果您正苦于以下问题:PHP base64url_encode函数的具体用法?PHP base64url_encode怎么用?PHP base64url_encode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了base64url_encode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: emailadmins

            function emailadmins($idofuser, $ticketid)
            {
                include '../page/db.php';
                $sql = "SELECT * FROM UserAccounts WHERE RowID='{$idofuser}'";
                $emaildata = mysqli_query($conn, $sql);
                $emaildata = mysqli_fetch_assoc($emaildata);
                $to = $emaildata['Email'];
                $subject = 'New Support Ticket';
                $message = '
								<html>
								<head>
								  <title>New Support Ticket</title>
								</head>
								<body>
								  <p>' . $emaildata['UserName'] . ',</p>
								  <p>A new support ticket was posted. Click here to view it <a href="http:ChrisSiena.com/support/TicketView?a=' . base64url_encode($ticketid) . '">http:ChrisSiena.com/support/TicketView?a=' . base64url_encode($ticketid) . '</a> or copy and paste this into your browser.</p><br />
								  <p>Do not reply to this email. It will not be checked.</p>
								</body>
								</html>
								';
                $headers .= 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                $headers .= 'From: ChrisSiena.com@ChrisSiena.com' . "\r\n";
                $headers .= 'Return-Path: return@ChrisSiena.com' . "\r\n";
                $headers .= 'X-Mailer: PHP/' . phpversion();
                mail($to, $subject, $message, $headers, '-freturn@ChrisSiena.com');
                mysqli_close($conn);
            }
开发者ID:Chris221,项目名称:My-Site,代码行数:28,代码来源:PostTicket.php

示例2: validate_credentials_front

 function validate_credentials_front()
 {
     $this->load->library('form_validation');
     $this->form_validation->set_rules('username', 'User Name', 'required');
     $this->form_validation->set_rules('password', 'Password', 'required');
     $this->form_validation->set_error_delimiters('<div class="alert alert-error"><a class="close" data-dismiss="alert">&#215;</a><strong>', '</strong></div>');
     if ($this->form_validation->run()) {
         if (!$this->session->userdata('is_logged_in')) {
             $this->load->model('Admin_model');
             $username = $this->input->post('username');
             $password = $this->__encrip_password($this->input->post('password'));
             $is_valid = $this->Admin_model->validate_front($username, $password);
             if ($is_valid) {
                 $where_username = " AND username='{$username}' OR primary_email='{$username}'";
                 $user_type = $this->common_model->getFieldData('user', 'type_of_membership', $where_username);
                 if ($user_type == "User") {
                     $is_account_confirm = $this->Admin_model->validate_front_account_confirm($username);
                     if ($is_account_confirm) {
                         $stored_user_data = $this->Admin_model->get_user_id($username);
                         $user_id = $stored_user_data[0]->user_id;
                         $primary_email = $stored_user_data[0]->primary_email;
                         $affiliate = $stored_user_data[0]->type;
                         $type_of_membership = $stored_user_data[0]->type_of_membership;
                         if (!empty($affiliate)) {
                             $type = $affiliate;
                         } else {
                             $type = 'user';
                         }
                         $data = array('username' => $username, 'primary_email' => $primary_email, 'user_id' => $user_id, 'type' => $type, 'type_of_membership' => $type_of_membership, 'is_logged_in' => true);
                         $this->session->set_userdata($data);
                         if ($affiliate == 'affiliate') {
                             redirect("signin/signin_user/{$user_id}/affiliate");
                         } else {
                             $email = base64url_encode($primary_email);
                             redirect("home/account/{$user_id}/{$email}");
                         }
                     } else {
                         $this->session->set_flashdata('flash_class', 'alert-danger');
                         $this->session->set_flashdata('flash_message', '<strong>ohh snap!</strong> Please Confirm Your Account By Your Email  </strong>');
                         redirect('signin/signin_user');
                     }
                 } else {
                     $this->session->set_flashdata('flash_class', 'alert-danger');
                     $this->session->set_flashdata('flash_message', '<strong>ohh snap!</strong> Your are Affiliate User Please login with Affilite login </strong>');
                     redirect('signin/signin_user');
                 }
             } else {
                 $url = '<a href="' . base_url() . 'home/set_pass_mail">reset your password</a>';
                 $this->session->set_flashdata('flash_class', 'alert-danger');
                 $this->session->set_flashdata('flash_message', '<strong>ohh snap!</strong> Wrong Username And Password  </strong>');
                 $this->session->set_flashdata('flash_reset_url', 'Please try again or <strong>' . $url . '</strong>');
                 redirect('signin/signin_user');
             }
         } else {
             redirect('home');
         }
     }
     $data['main_content'] = 'signin_view';
     $this->load->view('includes/template', $data);
 }
开发者ID:hardikamutech,项目名称:stacksclassifieds,代码行数:60,代码来源:signin.php

示例3: random_string

 function random_string($size = 64, $type = RANDOM_STRING_HEX)
 {
     // generate a bit of entropy and run it through the whirlpool
     $s = hash('whirlpool', (string) rand() . uniqid(rand(), true) . (string) rand(), $type == RANDOM_STRING_TEXT ? true : false);
     $s = $type == RANDOM_STRING_TEXT ? str_replace("\n", "", base64url_encode($s, true)) : $s;
     return substr($s, 0, $size);
 }
开发者ID:nextgensh,项目名称:friendica,代码行数:7,代码来源:text.php

示例4: slapper

function slapper($owner, $url, $slap)
{
    // does contact have a salmon endpoint?
    if (!strlen($url)) {
        return;
    }
    if (!$owner['channel_prvkey']) {
        logger(sprintf("channel '%s' (%d) does not have a salmon private key. Send failed.", $owner['channel_address'], $owner['channel_id']));
        return;
    }
    logger('slapper called for ' . $url . '. Data: ' . $slap, LOGGER_DATA, LOG_DEBUG);
    // create a magic envelope
    $data = base64url_encode($slap);
    $data_type = 'application/atom+xml';
    $encoding = 'base64url';
    $algorithm = 'RSA-SHA256';
    $keyhash = base64url_encode(hash('sha256', salmon_key($owner['channel_pubkey'])), true);
    // precomputed base64url encoding of data_type, encoding, algorithm concatenated with periods
    $precomputed = '.YXBwbGljYXRpb24vYXRvbSt4bWw=.YmFzZTY0dXJs.UlNBLVNIQTI1Ng==';
    $signature = base64url_encode(rsa_sign(str_replace('=', '', $data . $precomputed), $owner['channel_prvkey']));
    $signature2 = base64url_encode(rsa_sign($data . $precomputed, $owner['channel_prvkey']));
    $signature3 = base64url_encode(rsa_sign($data, $owner['channel_prvkey']));
    $salmon_tpl = get_markup_template('magicsig.tpl');
    $salmon = replace_macros($salmon_tpl, array('$data' => $data, '$encoding' => $encoding, '$algorithm' => $algorithm, '$keyhash' => $keyhash, '$signature' => $signature));
    // slap them
    $redirects = 0;
    $ret = z_post_url($url, $salmon, $redirects, array('headers' => array('Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon))));
    $return_code = $ret['return_code'];
    // check for success, e.g. 2xx
    if ($return_code > 299) {
        logger('compliant salmon failed. Falling back to status.net hack2');
        // Entirely likely that their salmon implementation is
        // non-compliant. Let's try once more, this time only signing
        // the data, without stripping '=' chars
        $salmon = replace_macros($salmon_tpl, array('$data' => $data, '$encoding' => $encoding, '$algorithm' => $algorithm, '$keyhash' => $keyhash, '$signature' => $signature2));
        $redirects = 0;
        $ret = z_post_url($url, $salmon, $redirects, array('headers' => array('Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon))));
        $return_code = $ret['return_code'];
        if ($return_code > 299) {
            logger('compliant salmon failed. Falling back to status.net hack3');
            // Entirely likely that their salmon implementation is
            // non-compliant. Let's try once more, this time only signing
            // the data, without the precomputed blob
            $salmon = replace_macros($salmon_tpl, array('$data' => $data, '$encoding' => $encoding, '$algorithm' => $algorithm, '$keyhash' => $keyhash, '$signature' => $signature3));
            $redirects = 0;
            $ret = z_post_url($url, $salmon, $redirects, array('headers' => array('Content-type: application/magic-envelope+xml', 'Content-length: ' . strlen($salmon))));
            $return_code = $ret['return_code'];
        }
    }
    logger('slapper for ' . $url . ' returned ' . $return_code);
    if (!$return_code) {
        return -1;
    }
    if ($return_code == 503 && stristr($ret['header'], 'retry-after')) {
        return -1;
    }
    return $return_code >= 200 && $return_code < 300 ? 0 : 1;
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:58,代码来源:salmon.php

示例5: generate_state_parameter

function generate_state_parameter()
{
    if (isset($_SESSION['state'])) {
        return $_SESSION['state'];
    } else {
        $state = base64url_encode(openssl_random_pseudo_bytes(32));
        $_SESSION['state'] = $state;
        return $state;
    }
}
开发者ID:dg711,项目名称:geekportal,代码行数:10,代码来源:generate_state.php

示例6: login_nonce

 function login_nonce(&$args)
 {
     /* generate a nonce (state) for this oauth request */
     function base64url_encode($data)
     {
         return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
     }
     $_SESSION['nonce'] = base64url_encode(openssl_random_pseudo_bytes(32));
     $args->retval = $_SESSION['nonce'];
 }
开发者ID:mountainstorm,项目名称:TeapotCMS,代码行数:10,代码来源:module.php

示例7: get

 function get()
 {
     $uid = local_channel();
     if (\App::$is_sys && is_site_admin()) {
         $sys = get_sys_channel();
         $uid = intval($sys['channel_id']);
     }
     if (!$uid) {
         notice(t('Permission denied.') . EOL);
         return '';
     }
     if (argc() == 1) {
         $channel = $sys ? $sys : \App::get_channel();
         // list menus
         $x = menu_list($uid);
         if ($x) {
             for ($y = 0; $y < count($x); $y++) {
                 $m = menu_fetch($x[$y]['menu_name'], $uid, get_observer_hash());
                 if ($m) {
                     $x[$y]['element'] = '[element]' . base64url_encode(json_encode(menu_element($channel, $m))) . '[/element]';
                 }
                 $x[$y]['bookmark'] = $x[$y]['menu_flags'] & MENU_BOOKMARK ? true : false;
             }
         }
         $create = replace_macros(get_markup_template('menuedit.tpl'), array('$menu_name' => array('menu_name', t('Menu Name'), '', t('Unique name (not visible on webpage) - required'), '*'), '$menu_desc' => array('menu_desc', t('Menu Title'), '', t('Visible on webpage - leave empty for no title'), ''), '$menu_bookmark' => array('menu_bookmark', t('Allow Bookmarks'), 0, t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))), '$submit' => t('Submit and proceed'), '$sys' => \App::$is_sys, '$display' => 'none'));
         $o = replace_macros(get_markup_template('menulist.tpl'), array('$title' => t('Menus'), '$create' => $create, '$menus' => $x, '$nametitle' => t('Menu Name'), '$desctitle' => t('Menu Title'), '$edit' => t('Edit'), '$drop' => t('Drop'), '$created' => t('Created'), '$edited' => t('Edited'), '$new' => t('New'), '$bmark' => t('Bookmarks allowed'), '$hintnew' => t('Create'), '$hintdrop' => t('Delete this menu'), '$hintcontent' => t('Edit menu contents'), '$hintedit' => t('Edit this menu'), '$sys' => \App::$is_sys));
         return $o;
     }
     if (argc() > 1) {
         if (intval(argv(1))) {
             if (argc() == 3 && argv(2) == 'drop') {
                 menu_sync_packet($uid, get_observer_hash(), intval(argv(1)), true);
                 $r = menu_delete_id(intval(argv(1)), $uid);
                 if (!$r) {
                     notice(t('Menu could not be deleted.') . EOL);
                 }
                 goaway(z_root() . '/menu' . (\App::$is_sys ? '?f=&sys=1' : ''));
             }
             $m = menu_fetch_id(intval(argv(1)), $uid);
             if (!$m) {
                 notice(t('Menu not found.') . EOL);
                 return '';
             }
             $o = replace_macros(get_markup_template('menuedit.tpl'), array('$header' => t('Edit Menu'), '$sys' => \App::$is_sys, '$menu_id' => intval(argv(1)), '$menu_edit_link' => 'mitem/' . intval(argv(1)) . (\App::$is_sys ? '?f=&sys=1' : ''), '$hintedit' => t('Add or remove entries to this menu'), '$editcontents' => t('Edit menu contents'), '$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'), '$menu_desc' => array('menu_desc', t('Menu title'), $m['menu_desc'], t('Menu title as seen by others'), ''), '$menu_bookmark' => array('menu_bookmark', t('Allow bookmarks'), $m['menu_flags'] & MENU_BOOKMARK ? 1 : 0, t('Menu may be used to store saved bookmarks'), array(t('No'), t('Yes'))), '$menu_system' => $m['menu_flags'] & MENU_SYSTEM ? 1 : 0, '$submit' => t('Submit and proceed')));
             return $o;
         } else {
             notice(t('Not found.') . EOL);
             return;
         }
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:51,代码来源:Menu.php

示例8: loadcomment

function loadcomment($id, $number)
{
    include '../page/protection.php';
    include '../page/db.php';
    $id = (int) base64url_decode($id);
    $sql = "SELECT * FROM Comments WHERE ID='{$id}'";
    $data = mysqli_query($conn, $sql);
    $data = mysqli_fetch_assoc($data);
    $userid = $data['UserID'];
    $usersql = "SELECT UserName,ProfilePicture FROM UserAccounts WHERE RowID='{$userid}'";
    $userdata = mysqli_query($conn, $usersql);
    $userdata = mysqli_fetch_assoc($userdata);
    $user = $userdata['UserName'];
    $comment = $data['Comment'];
    $space = "&emsp;";
    $postdate = date_create($data['CreateDate']);
    $postdate = date_format($postdate, 'm/d/Y g:ia');
    $modifieddate = date_create($data['ModifiedDate']);
    $modifieddate = date_format($modifieddate, 'm/d/Y g:ia');
    if ($userid === $_SESSION['id']) {
        $poster = "<span style=\"float:right;padding-right:10px;\" class=\"link2\"><a href=\"/admin/CommentDelete?a=" . base64url_encode($id) . "\">Delete</a></span>";
    }
    if ($data['Edited']) {
        $time = "<span style=\"float:right;\">Edited: " . $modifieddate . "</span>";
    } else {
        $time = "<span style=\"float:right;\">Posted: " . $postdate . "</span>";
    }
    $text .= "\n\t\t\t<div class=\"commentshadow\" id=\"comment-{$id}\">\n\t\t\t<div class=\"commenttitle\">#{$number} " . $time . $poster . "</div>\n\t\t\t<div class=\"fullcomment\">\n\t\t\t<!--<hr class=\"commenthr\">-->\n\t\t\t<div class=\"commentimage\">\n\t\t";
    $text .= "<div class=\"commentimageinner\"><span class=\"profilepichelper\"></span>";
    if (strlen($userdata['ProfilePicture'])) {
        $text .= "<img src=\"/account/ProfilePictureShow?a=" . base64url_encode($userid) . "\" class=\"commentpic\">";
    } else {
        $text .= "<img src=\"/theme/grey-question-mark.png\" class=\"commentpic hideLight\">";
        $text .= "<img src=\"/theme/darkgrey-question-mark.png\" class=\"commentpic hideDark\">";
    }
    $text .= "</div>";
    $text .= "\n\t\t\t</div>\n\t\t\t\t<div class=\"commentusername\"><span class=\"link3\"><a href=\"/account/Profile?a=" . base64url_encode($userid) . "\">{$user}</a></span></div>\n\t\t";
    include '../page/BBCode.php';
    if (isset($comment)) {
        $comment = decrypt($comment);
        $comment = strip_tags($comment);
        $comment = preg_replace('/\\r\\n?/', "\n<br />", $comment);
        $comment = bb_parse($comment);
    } else {
        $comment = '';
    }
    $text .= "<div class=\"comment\">" . $comment . "</div></div></div>";
    mysqli_close($conn);
    return $text;
}
开发者ID:Chris221,项目名称:My-Site,代码行数:50,代码来源:Comment.php

示例9: uploadButton

 /**
  * 输出上传图片按钮,调用上传窗口
  */
 public function uploadButton()
 {
     $config = $this->config;
     if (!isset($config['alowexts']) or empty($config['alowexts'])) {
         $config['alowexts'] = 'jpg,jpeg,gif,bmp,png,doc,docx';
     }
     $uploadObject = new UploadManager();
     if (!isset($config['uploadPath']) or empty($config['uploadPath'])) {
         $config['uploadPath'] = Config::get('sys.sys_upload_path') . '/';
     }
     $config['uploadPath'] = base64url_encode($config['uploadPath']);
     $config['uploadUrl'] = route('foundation.upload.index');
     //生成密钥,附止表单被修改。
     $authkey = $uploadObject->setParam($config)->uploadKey();
     return view('admin.widget.uploadbutton', compact('config', 'authkey'));
 }
开发者ID:pfdtk,项目名称:bmsys,代码行数:19,代码来源:Upload.php

示例10: make_rsa_jwk_key

function make_rsa_jwk_key($n, $e, $kid = NULL, $use = '')
{
    if (!$n || !$e) {
        return false;
    }
    $key_info = array('e' => base64url_encode($e), 'kty' => 'RSA', 'n' => base64url_encode($n));
    if ($kid) {
        $key_info['kid'] = $kid;
    } else {
        printf("jwk = %s\n", json_encode($key_info));
        $key_info['kid'] = base64url_encode(hash('sha256', json_encode($key_info), true));
    }
    if ($use) {
        $key_info['use'] = $use;
    }
    return $key_info;
}
开发者ID:reTHINK-project,项目名称:dev-IdPServer-phpOIDC,代码行数:17,代码来源:makejwk.php

示例11: get

 function get()
 {
     if (!is_site_admin()) {
         return;
     }
     $o = '';
     $r = q("select * from channel where channel_removed = 0");
     $sitekey = get_config('system', 'pubkey');
     if ($r) {
         foreach ($r as $rr) {
             $found = false;
             $primary_address = '';
             $x = zot_get_hublocs($rr['channel_hash']);
             if ($x) {
                 foreach ($x as $xx) {
                     if ($xx['hubloc_url'] === z_root() && $xx['hubloc_sitekey'] === $sitekey) {
                         $found = true;
                         break;
                     }
                 }
                 if ($found) {
                     $o .= 'Hubloc exists for ' . $rr['channel_name'] . EOL;
                     continue;
                 }
             }
             $y = q("select xchan_addr from xchan where xchan_hash = '%s' limit 1", dbesc($rr['channel_hash']));
             if ($y) {
                 $primary_address = $y[0]['xchan_addr'];
             }
             $hub_address = $rr['channel']['channel_address'] . '@' . \App::get_hostname();
             $primary = $hub_address === $primary_address ? 1 : 0;
             if (!$y) {
                 $primary = 1;
             }
             $m = q("delete from hubloc where hubloc_hash = '%s' and hubloc_url = '%s' ", dbesc($rr['channel_hash']), dbesc(z_root()));
             // Create a verified hub location pointing to this site.
             $h = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_primary, hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey, hubloc_network )\n\t\t\t\t\tvalues ( '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s' )", dbesc($rr['channel_guid']), dbesc($rr['channel_guid_sig']), dbesc($rr['channel_hash']), dbesc($rr['channel_address'] . '@' . \App::get_hostname()), intval($primary), dbesc(z_root()), dbesc(base64url_encode(rsa_sign(z_root(), $rr['channel_prvkey']))), dbesc(\App::get_hostname()), dbesc(z_root() . '/post'), dbesc($sitekey), dbesc('zot'));
             if ($h) {
                 $o . 'local hubloc created for ' . $rr['channel_name'] . EOL;
             } else {
                 $o .= 'DB update failed for ' . $rr['channel_name'] . EOL;
             }
         }
         return $o;
     }
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:46,代码来源:Fhublocs.php

示例12: validate_credentials_front

 function validate_credentials_front()
 {
     if (!$this->session->userdata('is_logged_in')) {
         $this->load->model('Admin_model');
         $username = $this->input->post('username');
         $password = $this->__encrip_password($this->input->post('password'));
         $is_account_confirm = $this->Admin_model->validate_front_account_confirm($username, $password);
         if ($is_account_confirm) {
             $is_valid = $this->Admin_model->validate_front($username, $password);
             if ($is_valid) {
                 $stored_user_data = $this->Admin_model->get_user_id($username);
                 $user_id = $stored_user_data[0]->user_id;
                 $primary_email = $stored_user_data[0]->primary_email;
                 $affiliate = $stored_user_data[0]->type;
                 $type_of_membership = $stored_user_data[0]->type_of_membership;
                 if (!empty($affiliate)) {
                     $type = $affiliate;
                 } else {
                     $type = 'user';
                 }
                 $data = array('username' => $username, 'primary_email' => $primary_email, 'user_id' => $user_id, 'type' => $type, 'type_of_membership' => $type_of_membership, 'is_logged_in' => true);
                 $this->session->set_userdata($data);
                 if ($affiliate == 'affiliate') {
                     redirect("signin/signin_user/{$user_id}/affiliate");
                 } else {
                     $email = base64url_encode($primary_email);
                     redirect("home/account/{$user_id}/{$email}");
                 }
             } else {
                 $url = '<a href="' . base_url() . 'home/set_pass_mail">reset your password</a>';
                 $this->session->set_flashdata('flash_class', 'alert-danger');
                 $this->session->set_flashdata('flash_message', '<strong>ohh snap!</strong> Wrong Username And Password  </strong>');
                 $this->session->set_flashdata('flash_reset_url', 'Please try again or <strong>' . $url . '</strong>');
                 redirect('signin/signin_user');
             }
         } else {
             $this->session->set_flashdata('flash_class', 'alert-danger');
             $this->session->set_flashdata('flash_message', '<strong>ohh snap!</strong> Please Confirm Your Account By Your Email  </strong>');
             redirect('signin/signin_user');
         }
     } else {
         redirect('home');
     }
 }
开发者ID:hardikamutech,项目名称:stacksclassifieds,代码行数:44,代码来源:signin(1-4-2015).php

示例13: index

 function index($param = NULL)
 {
     if (!isset($this->ci->session) || !$this->ci->session->userdata('uid')) {
         if ($this->ci->uri->segment(1) != 'login') {
             redirect('login/' . base64url_encode($this->ci->uri->uri_string()), 'location');
         }
     } else {
         $userInfo = $this->ci->User_Model->get($this->ci->session->userdata('uid'), 'username,fullname');
         $this->ci->username = $this->ci->User_Model->get($this->ci->session->userdata('uid'), 'username');
         // 			$this->ci->usertype = $this->ci->User_Model->usertype();
         // 			if( $this->ci->usertype =='partner' ){
         // 				$partnerID = $this->ci->Common_Model->getVal(array('owner'=>$this->ci->session->userdata('uid')),'id',$this->ci->Account_Model->partnerTable);
         // 				$this->ci->parterID = ( is_numeric($partnerID) ) ? $partnerID : NULL;
         // 			} else if ($this->ci->usertype =='customer') {
         // 				$partnerID = $this->ci->Common_Model->getVal(array('owner'=>$this->ci->session->userdata('uid')),'partner',$this->ci->Account_Model->companyTable);
         // 				$companyName = $this->ci->Common_Model->getVal(array('owner'=>$this->ci->session->userdata('uid')),'name',$this->ci->Account_Model->companyTable);
         // 				$this->ci->parterID = ( is_numeric($partnerID) ) ? $partnerID : NULL;
         // 				$this->ci->smartyci->assign('companyname',$companyName);
         // 			}
         $this->ci->smarty->assign('username', $userInfo->username);
         $this->ci->smarty->assign('fullname', $userInfo->fullname);
         // 			if( !class_exists('adminDesigns') ){
         // 			$this->ci->smartyci->assign('usertype',$this->ci->usertype);
     }
     $this->ci->suffix = $this->ci->config->item('url_suffix');
     if (isset($_SERVER['ORIG_PATH_INFO'])) {
         $pathInfo = pathinfo($_SERVER['ORIG_PATH_INFO']);
     } else {
         if (isset($_SERVER['PATH_INFO'])) {
             $pathInfo = pathinfo($_SERVER['PATH_INFO']);
         }
     }
     if (isset($pathInfo['extension']) && $pathInfo['extension']) {
         $this->ci->suffix = $pathInfo['extension'];
     }
     if ($this->ci->suffix == 'json') {
         header('Content-type: application/json');
     }
     $this->ci->lang->load('common', 'english');
     $this->ci->lang->load('common', 'vietnam');
 }
开发者ID:quanict,项目名称:annu,代码行数:41,代码来源:annu_hook.php

示例14: prate_post

function prate_post(&$a)
{
    if (!local_channel()) {
        return;
    }
    $channel = App::get_channel();
    $target = trim($_REQUEST['target']);
    if (!$target) {
        return;
    }
    if ($target === $channel['channel_hash']) {
        return;
    }
    $rating = intval($_POST['rating']);
    if ($rating < -10) {
        $rating = -10;
    }
    if ($rating > 10) {
        $rating = 10;
    }
    $rating_text = trim(escape_tags($_REQUEST['rating_text']));
    $signed = $target . '.' . $rating . '.' . $rating_text;
    $sig = base64url_encode(rsa_sign($signed, $channel['channel_prvkey']));
    $z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1", dbesc($channel['channel_hash']), dbesc($target));
    if ($z) {
        $record = $z[0]['xlink_id'];
        $w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'\n\t\t\twhere xlink_id = %d", intval($rating), dbesc($rating_text), dbesc($sig), dbesc(datetime_convert()), intval($record));
    } else {
        $w = q("insert into xlink ( xlink_xchan, xlink_link, xlink_rating, xlink_rating_text, xlink_sig, xlink_updated, xlink_static ) values ( '%s', '%s', %d, '%s', '%s', '%s', 1 ) ", dbesc($channel['channel_hash']), dbesc($target), intval($rating), dbesc($rating_text), dbesc($sig), dbesc(datetime_convert()));
        $z = q("select * from xlink where xlink_xchan = '%s' and xlink_link = '%s' and xlink_static = 1 limit 1", dbesc($channel['channel_hash']), dbesc($orig_record[0]['abook_xchan']));
        if ($z) {
            $record = $z[0]['xlink_id'];
        }
    }
    if ($record) {
        proc_run('php', 'include/ratenotif.php', 'rating', $record);
    }
    json_return_and_die(array('result' => true));
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:39,代码来源:prate.php

示例15: firstConnection

function firstConnection($id, $mdp, $IV)
{
    if (file_exists("C:\\wamp64\\www\\Web\\" . $id) != true) {
        $chemin = "C:\\wamp64\\www\\Web\\";
        //On creer un dossier.
        mkdir($chemin . $id);
    }
    //On creer un fichier ou on stocke le mdp.
    $chemin = "C:\\wamp64\\www\\Web\\" . $id . "\\Confg.txt";
    $handle = fopen($chemin, "w+");
    $mdp = chiffrement($mdp, $IV);
    $mdp = base64url_encode($mdp);
    fwrite($handle, "mdp:" . $mdp . "\r\n");
    $min = rand(0, 1000);
    $max = rand(100000, 1000000);
    $code = rand($min, $max);
    $code = chiffrement($code, $IV);
    $code = base64url_encode($code);
    fwrite($handle, "Code:" . $code);
    fclose($handle);
    return $code;
}
开发者ID:jeoff09,项目名称:Project-Optimisation,代码行数:22,代码来源:connection.php


注:本文中的base64url_encode函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。