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


PHP UserData類代碼示例

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


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


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