• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP UserData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: updateUserData

 public static function updateUserData()
 {
     $userDataArray = UserDataDB::getUserDataBy('userDataId', $_SESSION['arguments']);
     if (empty($userDataArray)) {
         HomeView::show();
         header('Location: /' . $_SESSION['base']);
     } elseif ($_SERVER["REQUEST_METHOD"] == "GET") {
         $_SESSION['userData'] = $userDataArray[0];
         UserDataView::showUpdate();
     } else {
         $userData = $userDataArray[0];
         $parms = $userData->getParameters();
         $parms['userId'] = array_key_exists('userId', $_POST) ? $_POST['userId'] : $userData->getUserId();
         $parms['user_name'] = array_key_exists('user_name', $_POST) ? $_POST['user_name'] : "";
         $parms['skill_level'] = array_key_exists('skill_level', $_POST) ? $_POST['skill_level'] : "";
         $parms['skill_areas'] = array_key_exists('skill_areas', $_POST) ? $_POST['skill_areas'] : array();
         $parms['profile_pic'] = array_key_exists('profile_pic', $_POST) ? $_POST['profile_pic'] : "";
         $parms['started_hobby'] = array_key_exists('started_hobby', $_POST) ? $_POST['started_hobby'] : "";
         $parms['fav_color'] = array_key_exists('fav_color', $_POST) ? $_POST['fav_color'] : "";
         $parms['url'] = array_key_exists('url', $_POST) ? $_POST['url'] : "";
         $parms['phone'] = array_key_exists('phone', $_POST) ? $_POST['phone'] : "";
         $newUserData = new UserData($parms);
         $newUserData->setUserDataId($userData->getUserDataId());
         $userDataEntry = UserDataDB::updateUserData($newUserData);
         if ($userDataEntry->getErrorCount() != 0) {
             $_SESSION['userData'] = array($newUserData);
             //return;
             UserDataView::showUpdate();
         } else {
             HomeView::show();
             header('Location: /' . $_SESSION['base']);
         }
     }
 }
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:34,代码来源:UserDataController.class.php


示例2: testGetCallsFileGetContentsWithUserId

 public function testGetCallsFileGetContentsWithUserId()
 {
     $fileGetContents = \idfly\Moka::spy('"USER"');
     $userData = new UserData($fileGetContents);
     $userData->get(1000);
     $this->assertEquals(['/data/1000.json'], $fileGetContents->report()[0]);
 }
开发者ID:idfly,项目名称:moka,代码行数:7,代码来源:UsersDataTest.php


示例3: fetchInfo

 public function fetchInfo()
 {
     global $srkEnv;
     $code = $_GET['code'];
     $data = (object) array('client_id' => $srkEnv->thirdPartyLogin['github']->clientId, 'client_secret' => $srkEnv->thirdPartyLogin['github']->clientSecret, 'code' => $code, 'accept' => 'json');
     $postRes = decipherGetStr(webPostData('https://github.com/login/oauth/access_token', $data));
     if (isset($postRes['access_token'])) {
         $accessToken = $postRes['access_token'];
         $dataStr = webGetData('https://api.github.com/user?access_token=' . $accessToken);
         $userInfo = json_decode($dataStr);
         if (!$userInfo) {
             return 'Data fetching error';
         }
         $userData = (object) array('userId' => 'github_' . $userInfo->login, 'email' => $userInfo->email, 'nickname' => $userInfo->name, 'accessToken' => $accessToken, 'avatarURL' => $userInfo->avatar_url, 'source' => 'github');
         $user = new UserData();
         $user->registerThirdParty($userData);
         $writeRes = $user->writeUser();
         if (!$writeRes) {
             $_SESSION['userId'] = $userData->userId;
         }
         return $writeRes;
     } else {
         return 'Access code error';
     }
 }
开发者ID:laekov,项目名称:shiruku,代码行数:25,代码来源:github.php


示例4: amp_badge_related_form

function amp_badge_related_form($data)
{
    $data = array_merge($data, $_GET);
    foreach ($data as $key => $value) {
        if (is_array($value) && count($value) == 1) {
            $quick_val = array_values($value);
            $data[$key] = $quick_val[0];
        }
    }
    $modin = isset($data['modin']) && $data['modin'] ? $data['modin'] : false;
    $related_index = isset($data['related_index']) && $data['related_index'] ? $data['related_index'] : false;
    if (!$modin) {
        return false;
    }
    if (!AMP_authenticate('admin')) {
        $live_forms = AMP_lookup('formsPublic');
        if (!isset($live_forms[$modin])) {
            return 'Please publish the related form';
        }
    }
    require_once 'AMP/UserData.php';
    $udm = new UserData(AMP_Registry::getDbcon(), $modin);
    $udm->registerPlugin('Output', 'Text');
    $udm->setData($data);
    $renderer = AMP_get_renderer();
    #    $delete_button = $renderer->form(
    $delete_button = $renderer->link('#', $renderer->image(AMP_SYSTEM_ICON_DELETE, array('class' => 'icon', 'style' => 'border: 0;')), array('alt' => AMP_TEXT_DELETE_ITEM, 'title' => AMP_TEXT_DELETE_ITEM, 'onClick' => "\$('form_related_item_{$related_index}').remove( ); \$('form_{$modin}_related_custom_fields_{$related_index}').remove(); return false;"));
    $content = $delete_button . $renderer->tag('pre', $udm->doPlugin('Output', 'Text'));
    $result = $renderer->div($content, array('class' => 'form_related_item', 'id' => 'form_related_item_' . $related_index));
    return $result;
}
开发者ID:radicaldesigns,项目名称:amp,代码行数:31,代码来源:RelatedForms.php


示例5: getUserData

 /**
  * ユーザーデータ取得
  * @param int (user_id)
  * @return array (user data)
  */
 public function getUserData()
 {
     $user_id = $this->input->get_post('id', TRUE);
     $user_data = new UserData();
     $data = $user_data->getUser($user_id);
     $this->output->set_output(json_encode($data));
     $this->output->_display();
     exit;
 }
开发者ID:go-braver,项目名称:lgb,代码行数:14,代码来源:Users.php


示例6: user

 /**
  * userデータの取得
  * @param user_id
  */
 function user()
 {
     $user_id = $_REQUEST['user_id'];
     $user_id = 1;
     $userData = new UserData();
     $data = $userData->get_user($user_id);
     $this->output->set_output(json_encode($data));
     $this->output->_display();
     exit;
 }
开发者ID:go-braver,项目名称:lgb,代码行数:14,代码来源:Test.php


示例7: questGo

 /**
  * 出発させる
  * @params
  * @return
  */
 public function questGo()
 {
     $data = array();
     $user_id = $this->input->get_post('user_id', TRUE);
     $quest_data = $this->input->get_post('quest_select', TRUE);
     $userData = new UserData();
     $userData->userQuestGo($user_id, $quest_data);
     // 更新したデータを返す
     $data = $userData->getUser($user_id);
     $this->output->set_output(json_encode($data));
     $this->output->_display();
     exit;
 }
开发者ID:hiyucc,项目名称:lgb,代码行数:18,代码来源:Users.php


示例8: run

 public static function run()
 {
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $userdata = new UserData($_POST);
         if ($userdata->getErrorCount() == 0) {
             ProfileView::show($userdata);
         } else {
             SignupView::show($userdata);
         }
     } else {
         // Initial link
         SignupView::show(null);
     }
 }
开发者ID:Trivette,项目名称:cs4413,代码行数:14,代码来源:SignupController.class.php


示例9: run

 public static function run()
 {
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $user = new User($_POST);
         $userData = new UserData($_POST);
         if ($user->getErrorCount() == 0 && $userData->getErrorCount() == 0) {
             HomeView::show();
         } else {
             SignupView::show($user, $userData);
         }
     } else {
         SignupView::show(null, null);
     }
 }
开发者ID:raroseman,项目名称:cs4413-Hoodflix,代码行数:14,代码来源:SignupController.class.php


示例10: refreshCurrentUser

 /**
  * 重新获取当前登录用户信息
  */
 protected function refreshCurrentUser()
 {
     $currUser = $this->getCurrentUser();
     $currUser = UserData::getById($currUser['id']);
     $_SESSION['user'] = array('id' => $currUser['id'], 'mobile' => $currUser['mobile'], 'email' => $currUser['email'], 'passwd' => $currUser['passwd'], 'name' => $currUser['name']);
     return $currUser;
 }
开发者ID:jianchengdu,项目名称:dangjia,代码行数:10,代码来源:BaseController.php


示例11: instance

 /**
  * This class implements the Singleton pattern. There is only ever
  * one instance of the this class and it is accessed only via the 
  * ClassName::instance() method.
  * 
  * @return object 
  * @access public
  * @since 5/26/05
  * @static
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new UserData();
     }
     return self::$instance;
 }
开发者ID:adamfranco,项目名称:harmoni,代码行数:17,代码来源:UserData.class.php


示例12: tryConnect

 public function tryConnect(SSH2DAO $ssh2dao)
 {
     UserData::$SSH2Data = $ssh2dao;
     $host = trim($ssh2dao->host);
     $port = $ssh2dao->port;
     $timeout = $ssh2dao->timeout;
     UserData::$SSH2Conn = new Net_SSH2($host, $port, $timeout);
 }
开发者ID:qickrooms,项目名称:flextermshell,代码行数:8,代码来源:SSH2ClientService.php


示例13: run

 public static function run()
 {
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         //simpleEcho.php;
         $user = new User($_POST);
         $userData = new UserData($_POST);
         //print_r($_FILES); echo '<br>';
         if ($user->getErrorCount() == 0 && $userData->getErrorCount() == 0) {
             ProfileView::show($userData);
         } else {
             SignupView::show($user, $userData);
         }
     } else {
         // Initial link
         SignupView::show(null, null);
     }
 }
开发者ID:mr-augustine,项目名称:sensor-data-repo,代码行数:17,代码来源:SignupController.class.php


示例14: getUnreadCount

 private function getUnreadCount()
 {
     $unreadCount = UserData::model()->getUnreadCount(Ibos::app()->user->uid);
     $sidebarUnreadMap["mention"] = $unreadCount["unread_atme"];
     $sidebarUnreadMap["comment"] = $unreadCount["unread_comment"];
     $sidebarUnreadMap["notify"] = $unreadCount["unread_notify"];
     $sidebarUnreadMap["pm"] = $unreadCount["unread_message"];
     return $sidebarUnreadMap;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:9,代码来源:MessageBaseController.php


示例15: run

 public static function run()
 {
     $user = null;
     $userData = null;
     if ($_SERVER["REQUEST_METHOD"] == "POST") {
         $user = new User($_POST);
         //$dbUser = UsersDB::addUser($user);
         $userData = new UserData($_POST);
         //$_POST["userId"] = $user->getUserId();
         if ($user->getErrorCount() == 0 && $userData->getErrorCount() == 0) {
             $dbUserData = UsersDB::addUser($user, $userData);
             ProfileView::show($user, $userData);
         } else {
             SignupView::show($user, $userData);
         }
     } else {
         SignupView::show(null, null);
     }
 }
开发者ID:raroseman,项目名称:cs4413-Hoodflix,代码行数:19,代码来源:SignupController.class.php


示例16: loginValidate

 public function loginValidate()
 {
     // post data
     $user_name = $this->input->get_post('user_name', TRUE);
     $password = $this->input->get_post('password', TRUE);
     $userData = new UserData();
     $isLogin = $userData->userLoginValidate($user_name, $password);
     $user = array();
     if ($isLogin) {
         $user = $userData->getUserByName($user_name);
         log_message('debug', 'ログイン成功');
     } else {
         $user['id'] = 0;
         log_message('debug', 'ログイン失敗');
         redirect('Login/login');
     }
     $data['data'] = $user['id'];
     $this->load->view('Mains/index', $data);
 }
开发者ID:go-braver,项目名称:lgb,代码行数:19,代码来源:Login.php


示例17: getUserData

 /**
  * @return mixed|string
  */
 public function getUserData()
 {
     try {
         return UserData::makeApiCall($this->username);
     } catch (InvalidUrlException $e) {
         return $e->getErrorMessage();
     } catch (InvalidUsernameException $e) {
         return $e->getErrorMessage();
     }
 }
开发者ID:andela-ooduye,项目名称:EvangelistStatus,代码行数:13,代码来源:EvangelistStatus.php


示例18: getHeader

 public function getHeader($lang = array())
 {
     $onlineStatus = UserUtil::getOnlineStatus($this->getUid());
     $styleMap = array(-1 => "o-pm-offline", 1 => "o-pm-online");
     $data = array("user" => $this->getUser(), "assetUrl" => $this->getAssetUrl("user"), "swfConfig" => AttachUtil::getUploadConfig(), "onlineIcon" => $styleMap[$onlineStatus], "lang" => $lang);
     if ($this->getIsWeiboEnabled()) {
         $data["userData"] = UserData::model()->getUserData($this->getUid());
         !$this->getIsMe() && ($data["states"] = Follow::model()->getFollowState(Ibos::app()->user->uid, $this->getUid()));
     }
     return $this->renderPartial("application.modules.user.views.header", $data, true);
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:11,代码来源:UserHomeBaseController.php


示例19: login

 /**
  * ログインバリデート
  */
 public function login()
 {
     $data = array();
     $user_name = $this->input->get_post('user_name', TRUE);
     $passwd = $this->input->get_post('passwd', TRUE);
     $userData = new UserData();
     $isLogin = $userData->userLoginValidate($user_name, $passwd);
     $user = array();
     if ($isLogin) {
         $user = $userData->getUserByName($user_name);
         log_message('debug', 'ログインに成功しているようです。');
     } else {
         $user['id'] = 0;
         log_message('debug', 'ログインに失敗しているようです。');
     }
     $data = $user;
     $this->output->set_output(json_encode($data));
     $this->output->_display();
     exit;
 }
开发者ID:asami-otsu,项目名称:lgb,代码行数:23,代码来源:Users.php


示例20: setDefaltInput

 protected function setDefaltInput()
 {
     parent::setDefaltInput();
     $yourUser = new UserData();
     $authorization = $yourUser->checkAuthorization();
     if ($authorization) {
         $userData = $yourUser->getUserData();
     }
     $this->insertValue['ip'] = parent::getOriginalPostValue('ip');
     //        $this->insertValue['fio'] = parent::getOriginalPostValue('fio');
     $this->insertValue['fio'] = $userData['login'];
     $this->insertValue['date'] = date("Y-m-d h:i:s");
     $this->insertValue['phone'] = parent::getOriginalPostValue('phone');
     $this->insertValue['email'] = parent::getOriginalPostValue('email');
     $this->insertValue['title'] = parent::getOriginalPostValue('title');
     $this->insertValue['text'] = parent::getOriginalPostValue('text');
     $this->insertValue['like'] = parent::getOriginalPostValue('like');
     $this->insertValue['dislike'] = parent::getOriginalPostValue('dislike');
     $this->insertValue['parentFeedback'] = parent::getOriginalPostValue('parentFeedback');
     $this->originalInsertValue = $this->insertValue;
 }
开发者ID:CompuProject,项目名称:Forsazh62,代码行数:21,代码来源:AP_CommentsAdd.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP UserFactory类代码示例发布时间:2022-05-23
下一篇:
PHP UserDao类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap