本文整理汇总了PHP中Members类的典型用法代码示例。如果您正苦于以下问题:PHP Members类的具体用法?PHP Members怎么用?PHP Members使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Members类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 - [email protected]
* @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
示例16: actionIndex
/**
* Show Form
*/
public function actionIndex()
{
$model = new ContactUs();
if (isset($_POST['ContactUs'])) {
$model->attributes = $_POST['ContactUs'];
if ($model->save()) {
// Do we need to email?
if (Yii::app()->params['contactusemail']) {
// Build Message
$message = Yii::t('contactus', "New Contact Us Form Submitted<br /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t Id: {id}<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\tBy: {name}<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\tEmail: {email}<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\tSubject: {subject}<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t========================<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{msg}<br />\n\t\t\t\t\t\t\t\t\t\t\t\t\t========================<br /><br />\n\t\t\t\t\t\t\t\t\t\t\t\t\tRegards, the {team} Team.", array('{id}' => $model->id, '{name}' => $model->name, '{email}' => $model->email, '{subject}' => $model->subject, '{msg}' => $model->content, '{team}' => Yii::app()->name));
$email = Yii::app()->email;
$email->subject = Yii::t('contactus', 'New Contact Us Form: {subject}', array('{subject}' => $model->subject));
$email->to = Yii::app()->params['emailout'];
$email->from = $model->email;
$email->replyTo = Yii::app()->params['emailout'];
$email->message = $message;
$email->send();
}
Yii::app()->user->setFlash('success', Yii::t('contactus', 'Thank You. The form submitted successfully.'));
$model = new ContactUs();
}
}
// If we are a member then fill in
if (Yii::app()->user->id) {
$user = Members::model()->findByPk(Yii::app()->user->id);
if ($user) {
$model->name = $user->username;
$model->email = $user->email;
}
}
$this->render('index', array('model' => $model));
}
开发者ID:hansenmakangiras,项目名称:yiiframework-cms,代码行数:35,代码来源:ContactusController.php
示例17: Is_Enabled
public function Is_Enabled()
{
if (!Members::CheckPermsKey('STATS_COMBAT')) {
Members::CheckPermsKeyAdd('STATS_COMBAT', AXX_MEMBER);
}
return true;
}
开发者ID:google-code-backups,项目名称:eude,代码行数:7,代码来源:cnh_fightstats.conf.php
示例18: actioneditauthitem
/**
* Edit auth item action
*/
public function actioneditauthitem()
{
// Perms
if (!Yii::app()->user->checkAccess('op_roles_edit_auth')) {
throw new CHttpException(403, Yii::t('error', 'Sorry, You don\'t have the required permissions to enter this section'));
}
if (isset($_GET['id']) && ($model = AuthItem::model()->find('name=:name', array(':name' => $_GET['id'])))) {
if (isset($_POST['AuthItem'])) {
$old_name = $model->name;
$model->attributes = $_POST['AuthItem'];
if ($model->save()) {
// Update parent name and child name in the auth child table
AuthItemChild::model()->updateAll(array('parent' => $model->name), 'parent=:name', array(':name' => $old_name));
AuthItemChild::model()->updateAll(array('child' => $model->name), 'child=:name', array(':name' => $old_name));
AuthAssignments::model()->updateAll(array('bizrule' => $model->bizrule, 'data' => $model->data, 'itemname' => $model->name), 'itemname=:name', array(':name' => $old_name));
Members::model()->updateAll(array('role' => $model->name), 'role=:name', array(':name' => $old_name));
Yii::app()->user->setFlash('success', Yii::t('adminroles', 'Auth Item Updated.'));
$this->redirect(array('roles/index'));
}
}
$this->breadcrumbs[Yii::t('adminroles', 'Editing auth item')] = '';
$this->pageTitle[] = Yii::t('adminroles', 'Editing auth item');
// Display form
$this->render('authitem_form', array('model' => $model, 'label' => Yii::t('adminroles', 'Editing auth item')));
} else {
Yii::app()->user->setFlash('error', Yii::t('adminerror', 'Could not find that ID.'));
$this->redirect(array('roles/index'));
}
}
开发者ID:hansenmakangiras,项目名称:yiiframework-cms,代码行数:32,代码来源:RolesController.php
示例19: getmessagecompose
public function getmessagecompose()
{
// $user_id = Sentry::getUser()->id;
// $agencies_id = Agency::where('staff_id','=',$user_id)->get();
// if ($agencies_id->isEmpty() )
// {
// return Redirect::to('dashboard/messages')
// ->with('errors','Kindly create an Agency First');
// }
// else
// {
// foreach ($agencies_id as $agency_id)
// {
// $my_agencyid= $agency_id->agency_id;
// $owner_id= $agency_id->owner_id;
// }
$profiles = Members::join('users', 'users.id', '=', 'registration.user_id')->get();
$allTeamsMember = array();
foreach ($profiles as $profile) {
if ($profile->user_id != Sentry::getUser()->id) {
$allTeamsMember[$profile->user_id] = $profile->email;
}
}
return View::make('message.messagecompose')->with('teams', $allTeamsMember);
// $profiles = Agency::where('agency_id','=',$my_agencyid)->get();
// $profiles = DB::table('agent')->where('agent_id',$owner_id)
// ->join('Agencystaff','agent.agent_id','=','Agencystaff.owner_id')
// ->get();
}
开发者ID:omusico,项目名称:zameenJayedad,代码行数:29,代码来源:MessageCentreController.php
示例20: authenticate
public function authenticate()
{
// $users=array(
// // username => password
// 'demo'=>'demo',
// 'admin'=>'admin',
// );
// if(!isset($users[$this->username]))
// $this->errorCode=self::ERROR_USERNAME_INVALID;
// elseif($users[$this->username]!==$this->password)
// $this->errorCode=self::ERROR_PASSWORD_INVALID;
// else
// $this->errorCode=self::ERROR_NONE;
// return !$this->errorCode;
$username = strtolower($this->username);
$password = $this->password;
$member = Members::model()->find('LOWER(pr_username)=?', array($username));
//$user = Account::model()->find('LOWER(account_email)=?',array($username));
if ($member === null) {
$this->errorCode = self::ERROR_PASSWORD_INVALID;
} elseif (Members::model()->generaSalt($password) != $member->pr_member_password || $member->pr_member_status == 0) {
$this->errorCode = self::ERROR_PASSWORD_INVALID;
} else {
$this->_id = $member->pr_primary_key;
$this->errorCode = self::ERROR_NONE;
}
return !$this->errorCode;
}
开发者ID:thongnv90,项目名称:bluesms,代码行数:28,代码来源:UserIdentity.php
注:本文中的Members类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论