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

PHP getUsername函数代码示例

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

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



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

示例1: printUserBox

function printUserBox()
{
    global $userData;
    global $isLoggedIn;
    global $authUrl;
    handleNameChange();
    echo "<div class='userBox box header'>";
    if ($isLoggedIn) {
        echo "<img class='circle-image' src='" . $userData['picture'] . "' width=100px height=100px /><br/>";
        if (!isset($_GET["settings"])) {
            echo "<p class='welcome'>Welcome <a href='" . $userData['link'] . "'>" . getUsername($userData) . "</a></p>";
        } else {
            echo "<form action='" . getUrl() . "' method='post'>";
            echo "<p class='welcome'>Welcome";
            echo "<input type='text' name='displayName' value='" . getUsername($userData) . "'/>";
            echo "<input type='submit' value='Submit'>";
            echo "</p></form>";
        }
        echo "<div class='userBoxBottom'>";
        echo "<div class='settings'><a href='?settings'><img src='Settings.png' width=16px height=16px /></a></div>";
        echo "<div class='logout'><a href='?logout'>Logout</a></div></div>";
    } else {
        echo "<a href='{$authUrl}'>Sign in using Google</a>";
    }
    echo "</div>";
}
开发者ID:Werner1201,项目名称:The-FoxPotato-Project,代码行数:26,代码来源:user.php


示例2: tambahAdminsubmit

 public function tambahAdminsubmit()
 {
     $this->form_validation->set_rules('USERNAME', 'USERNAME', 'required');
     $this->form_validation->set_rules('PASSWORD', 'PASSWORD', 'required');
     $this->form_validation->set_rules('PASSWORD2', 'Confrim password', 'required|matches[PASSWORD]');
     if ($this->form_validation->run() == FALSE) {
         $this->session->set_flashdata('notif', validation_errors());
         $this->session->set_flashdata('clr', 'danger');
         redirect('admin_user');
     }
     $cekpass = $this->user->tampilData('mp_user');
     foreach ($cekpass as $row) {
         if ($row->PASSWORD == acakPass($this->input->post('PASSWORD'))) {
             $this->session->set_flashdata('notif', 'Ulangi Password sudah terpakai');
             $this->session->set_flashdata('clr', 'warning');
             redirect('admin_user');
         }
     }
     $dataadmin = array('NAMA' => $this->input->post('NAMA'), 'NO_TELP' => $this->input->post('NO_TELP'), 'USERNAME' => getUsername($this->input->post('USERNAME'), 'admin'));
     $insertadmin = $this->user->tambahData($dataadmin, 'mp_admin');
     $data = array('ID_LEVEL' => '1', 'ID_AUTH' => $this->db->insert_id(), 'USERNAME' => getUsername($this->input->post('USERNAME'), 'admin'), 'PASSWORD' => acakPass($this->input->post('PASSWORD')));
     $insert = $this->user->tambahData($data, 'mp_user');
     if ($insert) {
         $this->session->set_flashdata('notif', 'admin berhasil di tambah');
         $this->session->set_flashdata('clr', 'success');
         redirect('admin_user');
     } else {
         $this->session->set_flashdata('notif', 'maaf data tidak bisa masuk ulangi lagi');
         $this->session->set_flashdata('clr', 'warning');
         redirect('admin_user');
     }
 }
开发者ID:rafiadji,项目名称:Indobaba,代码行数:32,代码来源:Admin_user.php


示例3: changeUsername

 /**
  * Changes user's username.
  * User must enter security number to prevent robot attacks.
  */
 public function changeUsername()
 {
     checkUnauthorizedAccess();
     $main = new Main();
     $main->setPageTitle("Username settings");
     $changeUsername = new ChangeUsername();
     $main->setBody($changeUsername);
     echo $main;
     $oldUsername = getUsername();
     if (post('change-username')) {
         $newUsername = post('first');
         $confirmNewUsername = post('second');
         $userSecurityNumber = post('security');
         $error = false;
         if (!ctype_alnum($newUsername) || strlen($newUsername) < 4 || strlen($newUsername) > 25) {
             $error = true;
         }
         if (!ctype_alnum($confirmNewUsername) || strlen($confirmNewUsername) < 4 || strlen($confirmNewUsername) > 25) {
             $error = true;
         }
         if ($userSecurityNumber < 1113 || $userSecurityNumber > 1207) {
             $error = true;
         }
         if ($newUsername === $confirmNewUsername && !$error) {
             UserRepository::changeUsername($oldUsername, $newUsername);
             $_SESSION['username'] = $newUsername;
         }
     }
 }
开发者ID:chiiiro,项目名称:SSP-TwitterApp,代码行数:33,代码来源:Settings.php


示例4: addAlbum

 function addAlbum($aData = array(), $bCheck = true)
 {
     if ($bCheck) {
         $iCheck = $this->_checkAlbumExistence($aData);
         if ($iCheck != 0) {
             return $iCheck;
         }
     }
     $iOwner = (int) $aData['owner'];
     if (isset($aData['AllowAlbumView'])) {
         $iAllowAlbumView = (int) $aData['AllowAlbumView'];
     } elseif (strpos($aData['caption'], getUsername($iOwner)) !== false) {
         $iAllowAlbumView = BX_DOL_PG_ALL;
     } else {
         $iAllowAlbumView = BX_DOL_PG_NOBODY;
     }
     $aFields = array('Caption' => $aData['caption'], 'Uri' => $this->getCorrectUri($aData['caption'], $iOwner, $bCheck), 'Location' => $aData['location'], 'Description' => $aData['description'], 'AllowAlbumView' => $iAllowAlbumView, 'Type' => $this->sType, 'Owner' => $iOwner, 'Status' => getParam('sys_album_auto_app') == 'on' ? 'active' : 'passive', 'Date' => time(), 'LastObjId' => isset($aData['lastObjId']) ? (int) $aData['last_obj'] : 0);
     $sqlBegin = "";
     $sqlCond = "";
     $sqlBody = $this->_getSqlPart($aFields);
     $sqlBegin = "INSERT INTO ";
     $sqlQuery = "{$sqlBegin} `{$this->sAlbumTable}` SET {$sqlBody} {$sqlCond}";
     $GLOBALS['MySQL']->res($sqlQuery);
     return $GLOBALS['MySQL']->lastId();
 }
开发者ID:noormcs,项目名称:studoro,代码行数:25,代码来源:BxDolAlbums.php


示例5: getBaseUrl

 function getBaseUrl()
 {
     $aEntry = $this->_oModule->oAlbums->getAlbumInfo(array('fileid' => $this->getId()));
     if (empty($aEntry) || !is_array($aEntry)) {
         return '';
     }
     return BX_DOL_URL_ROOT . $this->_oModule->_oConfig->getBaseUri() . 'browse/album/' . $aEntry['Uri'] . '/owner/' . getUsername($aEntry['Owner']);
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:8,代码来源:BxDolFilesCmtsAlbums.php


示例6: getBasicFileInfoForm

 function getBasicFileInfoForm(&$aInfo, $sUrlPref = '')
 {
     $aForm = parent::getBasicFileInfoForm($aInfo, $sUrlPref);
     if (!empty($aInfo['albumCaption']) && !empty($aInfo['albumUri'])) {
         $aForm['album'] = array('type' => 'value', 'value' => getLink($aInfo['albumCaption'], $sUrlPref . 'browse/album/' . $aInfo['albumUri'] . '/owner/' . getUsername($aInfo['medProfId'])), 'caption' => _t('_bx_files_album'));
     }
     return $aForm;
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:8,代码来源:BxFilesTemplate.php


示例7: getCacheOwnername

function getCacheOwnername($cacheid)
{
    $sql = "SELECT user_id FROM caches WHERE cache_id='" . sql_escape(intval($cacheid)) . "'";
    $query = mysql_query($sql) or die;
    if (mysql_num_rows($query) > 0) {
        return getUsername(mysql_result($query, 0));
    }
    return null;
}
开发者ID:pawelzielak,项目名称:opencaching-pl,代码行数:9,代码来源:viewpendings.php


示例8: auth

function auth()
{
    $u = getUsername();
    $p = getPassword();
    if (!trim($u) || !trim($p)) {
        return false;
    }
    return smfapi_authenticate(trim($u), trim($p), true);
}
开发者ID:rxadmin,项目名称:ufoai,代码行数:9,代码来源:apiauth.php


示例9: getLevel

function getLevel()
{
    $koneksi = mysql_connect('localhost', 'root', '');
    mysql_select_db('mtrain', $koneksi);
    $query = "SELECT level FROM admin WHERE username='" . getUsername() . "'";
    $mQuery = mysql_query($query);
    $result = mysql_fetch_array($mQuery);
    return $result['level'];
    mysql_close();
}
开发者ID:hyperzecters,项目名称:denliner,代码行数:10,代码来源:admin.php


示例10: testGetUsername

 public function testGetUsername()
 {
     // try basic
     $this->assertEquals($_SESSION['username'], 'old_user');
     $this->assertEquals(getUsername(), 'old_user');
     unset($_SESSION['username']);
     // try with not setted SESSION
     $this->assertFalse(isset($_SESSION['username']));
     $this->assertEquals(getUsername(), null);
 }
开发者ID:vmizoules,项目名称:ZZTasksPHP,代码行数:10,代码来源:authenticationTest.php


示例11: checkLoggedIn

function checkLoggedIn()
{
    // if logged in:
    if (isset($_SESSION['user_id']) && $_SESSION['user_id'] > 0) {
        $user = array("username" => getUsername(), "wood" => calcCurrentResources()["wood"], "iron" => calcCurrentResources()["iron"], "clay" => calcCurrentResources()["clay"], "level" => getLevel(), "villagers_in_use" => getVillagers(), "max_villagers" => getMaxVillagers());
    } else {
        // not logged in:
        $user = null;
    }
    return $user;
}
开发者ID:STEENBRINK,项目名称:PO_Informatica,代码行数:11,代码来源:reference.php


示例12: login4

 function login4($sUser, $sPwdClear)
 {
     $iId = 0;
     $aProfileInfo = getProfileInfo(getID($sUser));
     if ($aProfileInfo && ((32 == strlen($sPwdClear) || 40 == strlen($sPwdClear)) && BxDolXMLRPCUtil::checkLogin($sUser, $sPwdClear))) {
         $iId = $aProfileInfo['ID'];
     } elseif ($aProfileInfo && getParam('enable_dolphin_footer') != 'on' && check_password($aProfileInfo['ID'], $sPwdClear, BX_DOL_ROLE_MEMBER, false)) {
         $iId = $aProfileInfo['ID'];
     }
     return new xmlrpcresp(new xmlrpcval(array('member_id' => new xmlrpcval($iId, "int"), 'member_pwd_hash' => new xmlrpcval($iId ? $aProfileInfo['Password'] : ""), 'member_username' => new xmlrpcval($iId ? getUsername($iId) : ""), 'protocol_ver' => new xmlrpcval(BX_XMLRPC_PROTOCOL_VER, "int")), "struct"));
 }
开发者ID:toxalot,项目名称:dolphin.pro,代码行数:11,代码来源:BxDolXMLRPCUser.php


示例13: checkResetID

function checkResetID()
{
    if (isset($_GET['resetid'])) {
        $db = new DbObject();
        $resUser = $db->select("username", "Member", 'resetID="' . $_GET['resetid'] . '"');
        $username = getUsername($resUser);
        return $username;
    } else {
        return false;
    }
}
开发者ID:BethelH,项目名称:CWEB280-FinalProject,代码行数:11,代码来源:doReset.php


示例14: parseContent

 function parseContent($sContent, $aKeys, $iMemberId = 0)
 {
     $aResultKeys = $this->getDefaultKeys();
     if ($iMemberId != 0) {
         $aProfile = getProfileInfo($iMemberId);
         $aResultKeys = array_merge($aResultKeys, array('recipientID' => $aProfile['ID'], 'RealName' => getNickName($aProfile['ID']), 'NickName' => getNickName($aProfile['ID']), 'Username' => getUsername($aProfile['ID']), 'RecipientUrl' => getProfileLink($aProfile['ID']), 'Email' => $aProfile['Email'], 'Password' => $aProfile['Password'], 'SiteName' => getParam('site_title')));
     }
     if (is_array($aKeys)) {
         $aResultKeys = array_merge($aResultKeys, $aKeys);
     }
     return $GLOBALS['oSysTemplate']->parseHtmlByContent($sContent, $aResultKeys, array('<', '>'));
 }
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:12,代码来源:BxDolEmailTemplates.php


示例15: serviceSetAvatar

 function serviceSetAvatar($iPhotoID, $iAuthorId = 0)
 {
     if (!$iAuthorId) {
         $iAuthorId = getLoggedId();
     }
     $aFileInfo = $this->_oDb->getFileInfo(array('fileId' => $iPhotoID));
     $sProfileAlbumUri = uriFilter(str_replace('{nickname}', getUsername($iAuthorId), $this->_oConfig->getGlParam('profile_album_name')));
     if ($sProfileAlbumUri != $aFileInfo['albumUri']) {
         return false;
     }
     return $this->_oDb->setAvatar($iPhotoID, $aFileInfo['albumId']);
 }
开发者ID:noormcs,项目名称:studoro,代码行数:12,代码来源:BxPhotosModule.php


示例16: login

function login($userid, $userpassword)
{
    //check password for login
    $password = getUserpassword($userid);
    if (empty($password)) {
        echo "ID not found!";
    } else {
        if ($password == $userpassword) {
            echo "login success!";
            setSession($userid, getUsername($userid), getUsertype($userid));
        }
    }
}
开发者ID:tenling,项目名称:2016-SE_project-RMS_system,代码行数:13,代码来源:user_control.php


示例17: ajax_save_listing

function ajax_save_listing()
{
    global $wpdb;
    $user_id = explode(":", $_COOKIE["kallababy_user"])[0];
    $location = filter_var($_REQUEST["location"], FILTER_SANITIZE_STRING);
    $section = filter_var($_REQUEST["section"], FILTER_SANITIZE_STRING);
    $categories = $_REQUEST["categories"];
    $keywords = filter_var($_REQUEST["keywords"], FILTER_SANITIZE_STRING);
    $company_name = filter_var($_REQUEST["company_name"], FILTER_SANITIZE_STRING);
    $description = filter_var($_REQUEST["description"], FILTER_SANITIZE_STRING);
    $phone = filter_var($_REQUEST["phone"], FILTER_SANITIZE_STRING);
    $website = addhttp(filter_var($_REQUEST["website"], FILTER_SANITIZE_STRING));
    $email = filter_var($_REQUEST["email"], FILTER_SANITIZE_EMAIL);
    $features = $_REQUEST["features"];
    $logo = $_REQUEST["logo"];
    $banner = $_REQUEST["banner"];
    $gallery = $_REQUEST["gallery"];
    //create new listing
    $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_listing VALUES(NULL, '" . $user_id . "', '" . $location . "', '" . $section . "', '" . $keywords . "', '" . $company_name . "' , '" . $logo . "', '" . $banner . "', '" . $description . "', '', '', '', '', '', '', '', '" . $phone . "', '" . $website . "', '" . $email . "', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'testimonial.jpg', '', '', 'testimonial.jpg', '', '', 'testimonial.jpg', '', '0', '', '', '', '', '',  '" . date('Y-m-d H.i.s', time()) . "' )";
    $wpdb->query($sql);
    $listing_id = $wpdb->insert_id;
    //associate all categories with the new created listing
    for ($i = 0; $i < count($categories); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_categories VALUES('" . $listing_id . "', '" . $categories[$i] . "')";
        $wpdb->query($sql);
    }
    //associate all features with the new created listing
    for ($i = 0; $i < count($features); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_features VALUES('" . $listing_id . "', '" . $features[$i] . "')";
        $wpdb->query($sql);
    }
    //GALLERY
    //insert all images into gallery table
    for ($i = 0; $i < count($gallery); $i++) {
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_gallery VALUES( NULL, '" . $gallery[$i] . "', NULL )";
        $wpdb->query($sql);
        $gallery_id = $wpdb->insert_id;
        $sql = "INSERT INTO " . $wpdb->prefix . "kallababy_cross_gallery VALUES('" . $listing_id . "', '" . $gallery_id . "')";
        $wpdb->query($sql);
    }
    //send email to admin to notify of new listing
    $email = get_option("admin_email");
    $user_real_name = getUsername();
    $message = "A new listing has been created by " . $user_real_name . " for " . $company_name . "<br/>";
    $message .= "<a href='" . home_url() . "/basic-listing?id=" . $listing_id . "'>View Listing</a>";
    sendEmail($email, "New Listing", $message);
    $res = array('message' => "OK");
    echo json_encode($res);
    die;
}
开发者ID:altim,项目名称:kallababy,代码行数:50,代码来源:basiclisting.php


示例18: authenticate

 public function authenticate(MOXMAN_Auth_User $user)
 {
     $config = MOXMAN::getConfig();
     if (!isLogged()) {
         return false;
     }
     $s = getUsername();
     $sPath = BX_DIRECTORY_PATH_ROOT . 'media/moxie/files/' . substr($s, 0, 1) . '/' . substr($s, 0, 2) . '/' . substr($s, 0, 3) . '/' . $s;
     bx_mkdir_r($sPath);
     $config->put('filesystem.rootpath', $sPath);
     $config->replaceVariable("user", $s);
     $user->setName($s);
     return true;
 }
开发者ID:newton27,项目名称:dolphin.pro,代码行数:14,代码来源:Plugin.php


示例19: response

 function response($oAlert)
 {
     global $gConf;
     $iProfileId = $oAlert->iObject;
     if (!$iProfileId || $oAlert->sUnit != 'profile' || 'delete' != $oAlert->sAction && 'edit' != $oAlert->sAction) {
         return;
     }
     $sUsername = 'delete' == $oAlert->sAction ? $oAlert->aExtras['profile_info']['NickName'] : getUsername($iProfileId);
     if ('edit' == $oAlert->sAction && $oAlert->aExtras['OldProfileInfo']['NickName'] == $sUsername) {
         return;
     }
     $oDb = new DbForum();
     $sOldUsername = 'delete' == $oAlert->sAction ? $sUsername : $oAlert->aExtras['OldProfileInfo']['NickName'];
     $sNewUsername = 'delete' == $oAlert->sAction ? $gConf['anonymous'] : $sUsername;
     $oDb->renameUser($sOldUsername, $sNewUsername);
 }
开发者ID:Arvindvi,项目名称:dolphin,代码行数:16,代码来源:profile_response.php


示例20: _getMediaAlbumsArray

 function _getMediaAlbumsArray($sType, $iIdProfile, $iIdProfileViewer, $isShowEmptyAlbums = false)
 {
     switch ($sType) {
         case 'photo':
             $sModuleName = 'photos';
             $sType = 'bx_photos';
             $sMemAction = 'BX_PHOTOS_VIEW';
             break;
         case 'video':
             $sModuleName = 'videos';
             $sType = 'bx_videos';
             $sMemAction = 'BX_VIDEOS_VIEW';
             break;
         case 'music':
             $sModuleName = 'sounds';
             $sType = 'bx_sounds';
             $sMemAction = 'BX_SOUNDS_VIEW';
             break;
         default:
             return array();
     }
     if (!BxDolXMLRPCMedia::_isMembershipEnabledFor($iIdProfileViewer, $sMemAction)) {
         return array();
     }
     bx_import('BxDolMemberInfo');
     $oMemberInfo = BxDolMemberInfo::getObjectInstance(getParam('sys_member_info_thumb'));
     $isSetAvatarFromDefaultAlbumOnly = $oMemberInfo->isSetAvatarFromDefaultAlbumOnly();
     bx_import('BxDolAlbums');
     $o = new BxDolAlbums($sType, (int) $iIdProfile);
     $aList = $o->getAlbumList(array('owner' => (int) $iIdProfile, 'show_empty' => $isShowEmptyAlbums), 1, 1000);
     $aRet = array();
     foreach ($aList as $r) {
         if (!BxDolService::call($sModuleName, 'get_album_privacy', array((int) $r['ID'], $iIdProfileViewer), 'Search')) {
             continue;
         }
         if ($isSetAvatarFromDefaultAlbumOnly) {
             $isDefaulAlbum = $r['Uri'] == uriFilter(str_replace('{nickname}', getUsername($iIdProfile), getParam($sType . '_profile_album_name'))) ? 1 : 0;
         } else {
             $isDefaulAlbum = 1;
         }
         $aRet[] = array('Id' => $r['ID'], 'Title' => $r['Caption'], 'Num' => $r['ObjCount'], 'DefaultAlbum' => $isDefaulAlbum);
     }
     return $aRet;
 }
开发者ID:noormcs,项目名称:studoro,代码行数:44,代码来源:BxDolXMLRPCMedia.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP getUsers函数代码示例发布时间:2022-05-15
下一篇:
PHP getUserStatus函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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