當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Members類代碼示例

本文整理匯總了PHP中Members的典型用法代碼示例。如果您正苦於以下問題:PHP Members類的具體用法?PHP Members怎麽用?PHP Members使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Members類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: members

function members()
{
    $API = new PerchAPI(1.0, 'perch_members');
    $Members = new Members();
    $members = $Members->get_members('active');
    return $members;
}
開發者ID:amillionmonkeys,項目名稱:perchd,代碼行數:7,代碼來源:runtime.php

示例2: members

 public function members()
 {
     $mem = new Members($this->db);
     $this->f3->set('members', $mem->allWhereMemCards());
     $this->f3->set('content', 'app/views/cards-members.htm');
     echo Template::instance()->render('app/templates/default.htm');
 }
開發者ID:Renako,項目名稱:mytcg-f3,代碼行數:7,代碼來源:CardsController.php

示例3: registerNow

function registerNow()
{
    $members = new Members();
    $members->setValues($_REQUEST);
    if ($members->newMember()) {
        Common::jsonSuccess("Member Added Successfully");
    } else {
        Common::jsonError("Error");
    }
}
開發者ID:jcodesdotme,項目名稱:pp,代碼行數:10,代碼來源:login-controller.php

示例4: actionMembers

 /**
  * Displays the contact page
  */
 public function actionMembers()
 {
     $model = new Members('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Members'])) {
         $model->attributes = $_GET['Members'];
     }
     $this->render('admin', array('model' => $model));
 }
開發者ID:reubsc,項目名稱:sds,代碼行數:13,代碼來源:SiteController.php

示例5: index

 public function index()
 {
     if ($this->f3->exists('SESSION.userID')) {
         $members = new Members($this->db);
         $this->f3->set('member', $members->read(array('id=?', $this->f3->get('SESSION.userID')), [])[0]);
     }
     if ($this->f3->exists('POST.submit')) {
         $this->process();
     }
     $this->f3->set('content', 'app/views/contact.htm');
     echo Template::instance()->render('app/templates/default.htm');
 }
開發者ID:Renako,項目名稱:mytcg-f3,代碼行數:12,代碼來源:ContactController.php

示例6: showMemberProfile

 public function showMemberProfile($memberID)
 {
     $value = Session::get('key');
     $member = Members::find($memberID);
     $posts = DB::table('posts')->join('members', 'members.memberID', '=', 'posts.memberID')->where('members.memberID', $memberID)->get();
     $followings = DB::table('follow')->join('members', 'members.memberID', '=', 'follow.followMemberID')->where('follow.memberID', $memberID)->select('members.name', 'members.surname', 'members.memberID', 'members.photo')->get();
     $followers = DB::table('follow')->join('members', 'members.memberID', '=', 'follow.memberID')->where('follow.followMemberID', $memberID)->select('members.name', 'members.surname', 'members.memberID', 'members.photo')->get();
     $follow = false;
     foreach ($followers as $f) {
         //takipçilerinde oturumu açık olan kişi varsa follow true
         if ($f->memberID == $value) {
             $follow = true;
         }
     }
     $data = array('member' => $member, 'posts' => $posts, 'follow' => $follow, 'followers' => $followers, 'followings' => $followings);
     if (Session::get('adminLoggedIn')) {
         return View::make('admin/showMemberProfileForAdmin', $data);
     }
     if ($value == "") {
         //Session yoksa
         return View::make('showMemberProfile', $data);
     }
     if ($value == $memberID) {
         //Kendi profili ise kendi profiline yönlendirilir.
         return Redirect::to('profile');
     }
     return View::make('member/showMemberProfilForMember', $data);
 }
開發者ID:mitap45,項目名稱:Daily,代碼行數:28,代碼來源:HomeController.php

示例7: getAdress

 public function getAdress($id)
 {
     $team = Members::where('user_id', '=', $id)->get();
     foreach ($team as $teams) {
         return $teams->address;
     }
 }
開發者ID:omusico,項目名稱:zameenJayedad,代碼行數:7,代碼來源:User.php

示例8: addPermissions

 /**
  * Add permissions for a contact on members
  * @param array $members_id  Array with the ids of members
  * @param array $rol_permissions Array with the permissions for the user type of the contact
  * @return null
  */
 function addPermissions($members_id, $rol_permissions)
 {
     //permissions
     $permissions = "";
     foreach ($rol_permissions as $permission) {
         if ($permissions != "") {
             $permissions .= ',';
         }
         $permissions .= '{"pg":"' . $this->getId() . '","o":' . $permission['object_type_id'] . ',"d":' . $permission['can_delete'] . ',"w":' . $permission['can_write'] . ',"r":1}';
     }
     $permissions = "[" . $permissions . "]";
     //members
     $members = array();
     foreach ($members_id as $member_id) {
         $mem = Members::findById($member_id);
         if (!$mem instanceof Member) {
             continue;
         }
         $members[] = $mem;
     }
     //save permissions
     foreach ($members as $member) {
         save_member_permissions_background(logged_user(), $member, $permissions);
     }
 }
開發者ID:abhinay100,項目名稱:feng_app,代碼行數:31,代碼來源:PermissionGroup.class.php

示例9: authenticate

 /**
  * Authenticate a member
  *
  * @return int value greater then 0 means an error occurred 
  */
 public function authenticate()
 {
     $record = Members::model()->findByAttributes(array('email' => $this->name));
     if ($record === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
         $this->errorMessage = Yii::t('members', 'Sorry, But we can\'t find a member with those login information.');
     } else {
         if ($record->password !== $record->hashPassword($this->password, $record->email)) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
             $this->errorMessage = Yii::t('members', 'Sorry, But the password did not match the one in our records.');
         } else {
             $this->_id = $record->id;
             $auth = Yii::app()->authManager;
             if (!$auth->isAssigned($record->role, $this->_id)) {
                 if ($auth->assign($record->role, $this->_id)) {
                     Yii::app()->authManager->save();
                 }
             }
             // We add username to the state
             $this->setState('name', $record->username);
             $this->setState('username', $record->username);
             $this->setState('seoname', $record->seoname);
             $this->setState('email', $record->email);
             $this->setState('role', $record->role);
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return !$this->errorCode;
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:34,代碼來源:InternalIdentity.php

示例10: getWorkspaces

 static function getWorkspaces($limit = 10)
 {
     $ws_dim = Dimensions::findByCode('workspaces');
     $ws_object_type = self::instance()->getObjectTypeId();
     $sql = "dimension_id = " . $ws_dim->getId() . " AND object_type_id = {$ws_object_type}";
     $allowed_members = array();
     $add_ctx_members = true;
     $context = active_context();
     foreach ($context as $selection) {
         if ($selection instanceof Dimension && $selection->getCode() == 'workspaces') {
             $add_ctx_members = false;
         } else {
             if ($selection instanceof Member && $selection->getObjectTypeId() == $ws_object_type) {
                 $allowed_members[] = $selection->getId();
             }
         }
     }
     if ($add_ctx_members && count($allowed_members) > 0) {
         $sql .= " AND parent_member_id IN (" . implode(",", $allowed_members) . ")";
     } else {
         $sql .= " AND parent_member_id = 0";
     }
     $members = Members::findAll(array('conditions' => $sql, 'order' => 'name'));
     $res = array();
     foreach ($members as $mem) {
         // controlar permissos para cada fucking miembro
     }
     return $members;
 }
開發者ID:rorteg,項目名稱:fengoffice,代碼行數:29,代碼來源:Workspaces.class.php

示例11: authenticate

 /**
  * Authenticate a member
  *
  * @return int value greater then 0 means an error occurred 
  */
 public function authenticate()
 {
     $record = Members::model()->find('fbuid=:fbuid', array(':fbuid' => $this->fbuid));
     if ($record === null) {
         $this->errorCode = self::ERROR_UNKNOWN_IDENTITY;
         $this->errorMessage = Yii::t('members', 'Sorry, We could not find a member with that facebook account.');
     } else {
         if ($record->email != $this->fbemail) {
             $this->errorCode = self::ERROR_USERNAME_INVALID;
             $this->errorMessage = Yii::t('members', 'Sorry, But the emails of the accounts did no match.');
         } else {
             $this->_id = $record->id;
             $auth = Yii::app()->authManager;
             if (!$auth->isAssigned($record->role, $this->_id)) {
                 if ($auth->assign($record->role, $this->_id)) {
                     Yii::app()->authManager->save();
                 }
             }
             // We add username to the state
             $this->setState('name', $record->username);
             $this->setState('username', $record->username);
             $this->setState('seoname', $record->seoname);
             $this->setState('email', $record->email);
             $this->setState('role', $record->role);
             $this->errorCode = self::ERROR_NONE;
         }
     }
     return !$this->errorCode;
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:34,代碼來源:facebookIdentity.php

示例12: getModel

 /**
  * @return object - Members AR Object
  */
 private function getModel()
 {
     if (!$this->isGuest && $this->_model === null) {
         $this->_model = Members::model()->findByPk($this->id, array('select' => 'role'));
     }
     return $this->_model;
 }
開發者ID:hansenmakangiras,項目名稱:yiiframework-cms,代碼行數:10,代碼來源:CustomWebUser.php

示例13: rssAction

    public function rssAction()
    {
        $this->_includeTemplate = false;
        // to hide footer & header
        if (isset($_SESSION['connected']) && $_SESSION['connected'] == TRUE) {
            $idMember = $_SESSION['idMember'];
            $exams = Members::getRss($idMember);
            $rss = '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
		<channel>
			<title>List of exams :</title>
			<description>All informations about exams.</description>
			<pubDate>the current day</pubDate>';
            $i = 1;
            foreach ($exams as $r) {
                $rss = $rss . '<item>
				<title>Exams n°' . $i . ' : </title>
				<description>Doctor : ' . $r->getDoctor() . ', Service : ' . $r->getService() . ', Date : ' . $r->getDate() . ', Comment : ' . $r->getComment() . '</description>
                                </item>';
                $i++;
            }
            $rss = $rss . '</channel>
			</rss>';
            $this->rss = $rss;
            // transmit it to view
        } else {
            $this->redirect('/index/index');
        }
    }
開發者ID:rjoganah,項目名稱:Healthcare_social_network,代碼行數:29,代碼來源:IndexController.php

示例14: getInstance

 function getInstance()
 {
     if (!isset(self::$instance[get_class()])) {
         self::$instance = new Members();
     }
     return self::$instance;
 }
開發者ID:reboxhost,項目名稱:phpb2b,代碼行數:7,代碼來源:member.php

示例15: validateObjectContext

 /**
  * Returns true if the object blongs to the texmplate context ($memberIds)
  * @author Ignacio Vazquez - elpepe.uy@gmail.com
  * @param ContentDataObject $object
  * @param array $memberIds
  */
 static function validateObjectContext($object, $memberIds)
 {
     $valid = true;
     // Dimensiones requeridas para el tipo de objecto
     $dimensions = Dimensions::getAllowedDimensions(self::instance()->getObjectTypeId());
     $requiredDimensions = array();
     foreach ($dimensions as $dim) {
         if ($dim['is_required']) {
             $requiredDimensions[$dim['dimension_id']] = $dim;
             // Performance, dim id in the array key  ! ! !
         }
     }
     // Miembros del Objeto
     $objMembers = $object->getMemberIds();
     // P/cada miembro
     foreach ($objMembers as $mid) {
         $member = Members::instance()->findById($mid);
         if ($member instanceof Member) {
             /* @var  $member Member */
             $did = $member->getDimensionId();
             // Si la dimension del miembro esta en la requeridas
             if ($requiredDimensions[$did]) {
                 if (!in_array($mid, $memberIds)) {
                     $valid = false;
                 }
             }
         }
     }
     if (!$valid) {
         throw new DAOValidationError($this, array(lang("template members do not match object members")));
     }
 }
開發者ID:rorteg,項目名稱:fengoffice,代碼行數:38,代碼來源:COTemplates.class.php


注:本文中的Members類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。