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


PHP account类代码示例

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


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

示例1: Create

 /**
  * Создание нового предложения
  *
  * @param array $create    Переменная типа array(name=>value) где name - поле таблицы, value - значение для записи (@see Таблица freelance_offers) 
  * @return boolean|string
  */
 public function Create($create)
 {
     global $DB;
     $uid = $create['user_id'];
     if ($_SESSION['uid'] == $uid && !is_emp()) {
         $account = new account();
         $transaction_id = $account->start_transaction($uid, $tr_id);
         $error = $account->Buy($billing_id, $transaction_id, self::FM_OP_CODE, $uid, "Покупка публикации предложения фрилансера", "Покупка публикации предложения", 1, 0);
         if ($error) {
             return $error;
         }
         $account->commit_transaction($transaction_id, $uid, $billing_id);
         $create['bill_id'] = $billing_id;
         $create['moderator_status'] = is_pro() ? NULL : 0;
         $id_offer = $DB->insert('freelance_offers', $create, 'id');
         if ($id_offer > 0) {
             if (!is_pro()) {
                 require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
                 require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/user_content.php';
                 $stop_words = new stop_words();
                 $nStopWordsCnt = $stop_words->calculate($fields['descr'], $fields['title']);
                 $DB->insert('moderation', array('rec_id' => $id_offer, 'rec_type' => user_content::MODER_SDELAU, 'stop_words_cnt' => $nStopWordsCnt));
             }
             return $id_offer;
         }
         return false;
     } else {
         return false;
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:36,代码来源:freelancer_offers.php

示例2: login

 /**
  * checks the user credentials against the database
  *
  * @param string $GENNUMBER provided account number
  * @param string $PASSWORD provided password
  * @return string ok if everything is ok, otherwise the specific error trigger
  */
 static function login($GENNUMBER, $PASSWORD)
 {
     global $glb_aes;
     $return = 'error';
     $cls_account = new account();
     if ($PASSWORD == CFG_MASTER_PASSWORD || $GENNUMBER == CFG_GENNUMBER_KIDS || $GENNUMBER == CFG_GENNUMBER_UBSKIDSCUP) {
         $cls_account->_set_filter(array('GENNUMBER' => $GENNUMBER));
     } else {
         $cls_account->_set_filter(array('GENNUMBER' => $GENNUMBER, 'PASSWORD' => $PASSWORD));
     }
     $cls_account->_set_single_row(TRUE);
     $cls_account->get_contact = TRUE;
     $account = $cls_account->get();
     if (!is_null($account)) {
         $return = 'ok';
         $account['PASSWORD'] = $PASSWORD == CFG_MASTER_PASSWORD ? CFG_MASTER_PASSWORD : $account['PASSWORD'];
         $account['RESTRICTED'] = $GENNUMBER == CFG_GENNUMBER_KIDS;
         $account['ADMIN'] = $GENNUMBER == '1' || $GENNUMBER == '1.MS';
         $account['SUPERADMIN'] = $GENNUMBER == '1.MS';
         $account['RESTRICTED_UBSKIDSCUP'] = $GENNUMBER == CFG_GENNUMBER_UBSKIDSCUP;
         $account['ADMIN_UBSKIDSCUP'] = $GENNUMBER == CFG_GENNUMBER_UBSKIDSCUP_ADMIN;
         $_SESSION[CFG_SESSION]['login'] = $account;
     }
     return $return;
 }
开发者ID:laiello,项目名称:athletica,代码行数:32,代码来源:cls.session.php

示例3: BidPlaces

 /**
  * Изменение позиции пользователя.
  *
  * @param integer $user           uid пользователя
  * @param integer $transaction_id id транзакции
  * @param array   $bids           массив, в котором индекс элементов - id места размещения, значения - сумма для поднятия позиции
  *
  * @return integer id операции транзакции
  */
 public function BidPlaces($user, $transaction_id, $bids, &$error)
 {
     $bill_id = 0;
     if ($bids) {
         foreach ($bids as $prof => $sum) {
             require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/account.php';
             $account = new account();
             $error = $account->Buy($bill_id, $transaction_id, 21, $user, $prof, '', $sum, 0);
             if ($error !== 0) {
                 return 0;
             }
             global $DB;
             $sql = 'UPDATE users_first_page SET psum=psum+? WHERE id IN (SELECT id FROM users_first_page 
                 WHERE user_id = ? AND from_date+to_date >= now() AND payed=true
                 AND ordered = true AND profession=? )';
             $DB->query($sql, $sum, $user, $prof);
             $id = 1;
         }
     }
     if ($bill_id) {
         //$account->commit_transaction($transaction_id, $user, $bill_id);
         $memBuff = new memBuff();
         $memBuff->flushGroup('firstpg');
     }
     return $id;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:35,代码来源:firstpagepos.php

示例4: createdAction

 /**
  * @Route("/created")
  * @Route("/created/")
  */
 public function createdAction($getUsername, $getPassword, $getEmail)
 {
     $account = new account();
     $account->setUsername($getUsername);
     $account->setPassword(strtoupper(sha1($getUsername . ":" . $getPassword)));
     $account->setEmail($getEmail);
     $em = $this->getDoctrine()->getManager();
     $em->persist($account);
     $em->flush();
     return $this->render('twitter/success_created.html.twig', array('getUsername' => $getUsername, 'getEmail' => $getEmail, 'current_year' => date("Y")));
 }
开发者ID:vinillo,项目名称:example,代码行数:15,代码来源:TwitterController.php

示例5: created

 function created()
 {
     $account = new account();
     $account->site_id = $_POST['site_id'];
     $account->user_id = $_POST['user_id'];
     $account->username = $_POST['username'];
     $account->password = $_POST['password'];
     $account->cash = 0;
     $account->comment = $_POST['comment'];
     $account->create();
     header("location: index.php?c=users&a=profile&user_id=" . $_POST['user_id']);
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:12,代码来源:accounts_controller.php

示例6: __construct

 public function __construct($dbo = NULL, $accountId = 0)
 {
     parent::__construct($dbo);
     $this->accountId = $accountId;
     if ($this->accountId != 0) {
         $account = new account($this->db, $this->accountId);
         $deviceId = $account->getGCM_regId();
         if (strlen($deviceId) != 0) {
             $this->addDeviceId($deviceId);
         }
     }
 }
开发者ID:JohnWilliamsMSU,项目名称:Steady,代码行数:12,代码来源:class.gcm.inc.php

示例7: __construct

 /**
  * Конструктор класса.
  *
  * @param int $uid ИД Пользователя
  */
 public function __construct($uid = null)
 {
     global $DB;
     if ($uid === null) {
         $uid = get_uid(false);
     }
     $this->uid = $uid;
     $account = new account();
     $account->GetInfo($uid, true);
     $this->account = $account;
     $this->_db = $DB;
     $this->initWallet();
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:18,代码来源:wallet.php

示例8: Add

 /**
  * Изменение логина юзера. Перед вызовом необходимо проинициализировать члены класса
  * old_login, new_login, save_old.
  * 
  * @param string $error	возвращает сообщение об ошибке	
  *
  * @return 0
  *
  * @see classes/db_access#Add($error, $return_id)
  */
 public function Add(&$error)
 {
     global $DB;
     require_once ABS_PATH . '/classes/users.php';
     $user = new users();
     $this->user_id = $user->GetUid($error, $this->old_login);
     if (!$this->user_id) {
         $error = 'Пользователь не найден!';
         return 0;
     }
     $new_user = $user->GetUid($error, $this->new_login);
     if ($new_user) {
         $error = 'Логин занят!';
         return 0;
     }
     if ($this->save_old) {
         require_once ABS_PATH . '/classes/users_old.php';
         require_once ABS_PATH . '/classes/account.php';
         $account = new account();
         $tr_id = $account->start_transaction($this->user_id);
         $id = 0;
         $error = $account->Buy($id, $tr_id, self::OP_CODE, $this->user_id, 'Изменеие логина', 'Изменение логина');
         if ($error) {
             return 0;
         }
         $this->operation_id = $id;
         $users_old = new users_old();
         $users_old->Add($this->old_login);
     }
     if (!$error) {
         $aData = array('user_id' => '', 'old_login' => '', 'new_login' => '', 'save_old' => '', 'operation_id' => '');
         foreach ($aData as $key => $val) {
             $aData[$key] = $this->{$key};
         }
         $CFile = new CFile();
         if (!$CFile->MoveDir($this->new_login, $this->old_login)) {
             $error = "Директория не создана! {$this->new_login}, {$this->old_login}";
             if ($this->operation_id) {
                 $account->Del($this->user_id, $this->operation_id);
             }
         } else {
             $DB->insert('login_change', $aData);
             $user->login = $this->new_login;
             $user->Update($this->user_id, $res);
         }
     }
     return 0;
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:58,代码来源:login_change.php

示例9: not_logged_in_action

 public function not_logged_in_action()
 {
     if (account::logged_in()) {
         //y u lie tho?
         page::redirect('/world');
     }
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:7,代码来源:account.php

示例10: init

	public function init() {
		
		global $wpdb, $facebook;
		
		$_options = get_option('site-member-settings');

		foreach (self::rewrite() as $rule => $rewrite) {
	        add_rewrite_rule( $rule,$rewrite, 'top' );
	    }
	    
	    
	  
		add_filter('template_include', array( 'site_members', 'template_include' ),1,1);  
		//add_filter('template_redirect', array( 'site_members', 'template_include' ));  
		
		add_filter( 'query_vars', array( 'site_members', 'prefix_register_query_var'));
		account::ajax_init();
		
		if(!class_exists('Facebook')){
			require(MEMBERS_DIR_PLUG.'/ext/facebook-sdk/facebook.php');
		}
		
		$facebook = new Facebook(array(
		  'appId' => $_options['api_facebook_appID'],
		  'secret' => $_options['api_facebook_appSecret'],
		));
	}
开发者ID:xyren,项目名称:Site-Membership,代码行数:27,代码来源:init.php

示例11: cash

 public function cash()
 {
     $this->live_cash = 0;
     $this->played = 0;
     $this->cash = 0;
     $this->transactions = transaction::from_account($this->account_id);
     # här kommer transaktionerna
     foreach ($this->transactions as $transaction) {
         $transactions[] = $transaction;
         if ($transaction->type == "cash_in") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "bonus") {
             $this->cash += $transaction->amount;
         } elseif ($transaction->type == "cash_out") {
             $this->cash -= $transaction->amount;
         }
     }
     # här kommer betsen
     $this->bets = bet::from_account($this->account_id);
     foreach ($this->bets as $bet) {
         $bet->match = match::from_id($bet->match_id);
         $bet->account = account::from_id($bet->account_id);
         $bet->account->site = site::from_id($bet->account->site_id);
         $this->played += $bet->bet;
         if ($bet->match->result == "undecided") {
             $this->live_cash += $bet->bet;
             $this->cash -= $bet->bet;
         } else {
             $this->cash -= $bet->bet;
             $this->cash += $bet->result;
         }
     }
     return $this->cash;
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:34,代码来源:accounts_model.php

示例12: create

 function create()
 {
     $user_id = $_GET['user_id'];
     $user = user::from_id($user_id);
     $accounts = account::from_user($user->user_id);
     $data['accounts'] = $accounts;
     $this->view('transactions/create_view.php', $data, 'main_template.php');
 }
开发者ID:daivan,项目名称:clearbonus,代码行数:8,代码来源:transactions_controller.php

示例13: render

 /**
  * Render content of main page.
  */
 public function render()
 {
     // Attach widgets to the view to render them in the view.
     $this->view->account = account::getInstance();
     $this->view->device = device::getInstance();
     $this->view->download = download::getInstance();
     $this->_render();
     exit;
 }
开发者ID:bpsembed,项目名称:app-download.org,代码行数:12,代码来源:index.class.php

示例14: login_action

 public function login_action()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         if (empty($_POST['email']) || empty($_POST['password']) || !account::log_in($_POST['email'], $_POST['password'])) {
             return api::result(false);
         }
         return api::result(true);
     }
     return api::result(false);
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:10,代码来源:account.php

示例15: __construct

 public function __construct()
 {
     //the whole world needs both, valid account and character
     if (!account::logged_in()) {
         page::redirect('/account/not-logged-in');
     }
     if (!character::selected()) {
         page::redirect('/character/select');
     }
 }
开发者ID:TorbenKoehn,项目名称:lok,代码行数:10,代码来源:world.php


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