当前位置: 首页>>代码示例>>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;未经允许,请勿转载。