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


PHP UserModel::getMember方法代码示例

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


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

示例1: indexAction

 public function indexAction()
 {
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         throw new Exception("Please login");
     }
     $user = User::factory($auth->getIdentity());
     if (!$user->isAdmin()) {
         throw new Exception("You must be an admin to view this page.");
     }
     $this->_helper->viewRenderer->setNoRender();
     Zend_Loader::loadClass("UserModel");
     $usermodel = new UserModel();
     $users = $usermodel->getUserList();
     foreach ($users as $username) {
         $user = User::factory($username);
         $memcount = $usermodel->getMemberCount($user);
         for ($i = 0; $i < $memcount; $i++) {
             $member = $usermodel->getMember($user, $i);
             if (!empty($member->email)) {
                 echo "{$member->email}, ";
             }
         }
     }
 }
开发者ID:rajatkhanduja,项目名称:opc,代码行数:25,代码来源:EmailController.php

示例2: getgravatar

/**
 * Copyright 2007-2009 Chennai Mathematical Institute
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * @file   GravatarModel.php
 * @author Arnold Noronha <arnold@cmi.ac.in>
 */
function getgravatar($user)
{
    Zend_Loader::loadClass("UserModel");
    $userm = new UserModel();
    $user = $userm->getRow($user);
    $email = $userm->getMember($user, 0)->email;
    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=" . md5(strtolower($email)) . '&amp;size=40';
    return $grav_url;
}
开发者ID:rajatkhanduja,项目名称:opc,代码行数:29,代码来源:GravatarModel.php

示例3: indexAction

 public function indexAction()
 {
     $_user = $this->_request->get("user");
     if (webconfig::getContest()->isQueuePrivate()) {
         $user = User::factory(Zend_Auth::getInstance()->getIdentity());
         if (!$user || !$user->isAdmin()) {
             $this->_forward("privacy", "error", NULL, array());
         }
     }
     if (empty($_user)) {
         $this->_redirect(webconfig::getContestRelativeBaseUrl());
     }
     /* fillin information from User XML data */
     Zend_Loader::loadClass("UserModel");
     $userm = new UserModel();
     $user = $userm->getRow($_user);
     $this->view->username = $user->_username;
     $this->view->inst = $userm->getInstitute($user);
     $this->view->name = $userm->getMember($user, 0)->name;
 }
开发者ID:rajatkhanduja,项目名称:opc,代码行数:20,代码来源:UsersController.php

示例4: resetAction

 function resetAction()
 {
     Zend_Loader::loadClass("UserModel");
     $userm = new UserModel();
     $user = $this->_request->get("user");
     $key = $this->_request->get("key");
     $obj = $userm->getRow($user);
     if (empty($obj) or empty($key)) {
         $this->_redirect("/");
     }
     $savedkey = $this->cache->load($user);
     if ($savedkey != $key) {
         $this->_redirect("/");
     }
     $this->cache->remove($user);
     $pass = "";
     for ($i = 0; $i < 8; $i++) {
         $pass = $pass . mt_rand(0, 9);
     }
     /* send email */
     $mail = Mailer::get_mailer();
     $baseurl = Zend_Controller_Front::getInstance()->getBaseUrl();
     if ($baseurl == "/") {
         $baseurl = "";
     }
     $mail->setBodyText("\n\nYou are receiving this email because you wished to reset your password\non http://{$_SERVER['SERVER_NAME']}{$baseurl}.\n\nWe have changed your password to: {$pass}\n\nPlease try logging in using this password and change it as soon as\npossible.\n\n");
     $mail->addTo($userm->getMember($obj, 0)->email, $userm->getMember($obj, 0)->name);
     $mail->setSubject("Password Reset");
     $mail->send();
     $obj->setPassword($pass);
 }
开发者ID:rajatkhanduja,项目名称:opc,代码行数:31,代码来源:ForgotPasswordController.php

示例5: updateAction

 public function updateAction()
 {
     $this->view->mode = "update";
     /* fill in the existing details */
     $auth = Zend_Auth::getInstance();
     if (!$auth->hasIdentity()) {
         $this->_forward("illegal", "error");
         return;
     }
     $this->user = $auth->getIdentity();
     Zend_Loader::loadClass("UserModel");
     $userm = new UserModel();
     $user = $userm->getRow($this->user);
     $this->user = $user->_username;
     $this->institute = $userm->getInstitute($user);
     $this->country = $userm->getCountry($user);
     $this->timezone = $userm->getTimezone($user);
     $this->name0 = $userm->getMember($user, 0)->name;
     $this->email0 = $userm->getMember($user, 0)->email;
     $count = $userm->getMemberCount($user);
     if ($count > 1) {
         $this->name1 = $userm->getMember($user, 1)->name;
         $this->email1 = $userm->getMember($user, 1)->email;
     }
     if ($count > 2) {
         $this->name2 = $userm->getMember($user, 2)->name;
         $this->email2 = $userm->getMember($user, 2)->email;
     }
     $this->copyToView();
 }
开发者ID:rajatkhanduja,项目名称:opc,代码行数:30,代码来源:ProfileController.php


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