本文整理汇总了PHP中ctrl_users类的典型用法代码示例。如果您正苦于以下问题:PHP ctrl_users类的具体用法?PHP ctrl_users怎么用?PHP ctrl_users使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ctrl_users类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: GetModuleList
/**
* Gets the module list as an array from a given category ID.
* @author Bobby Allen ([email protected])
* @global db_driver $zdbh The ZPX database handle.
* @param int $catid The name of the module category to get the list of modules from.
* @return array Array containing the list of modules for the category ID supplied.
*/
static function GetModuleList($catid = "")
{
global $zdbh;
$user = ctrl_users::GetUserDetail();
if ($catid == "") {
$sql = "SELECT * FROM x_modules";
} else {
$sql = "SELECT * FROM x_modules WHERE mo_category_fk = :catid AND mo_type_en = 'user' AND mo_enabled_en = 'true' ORDER BY mo_name_vc";
}
$numrows = $zdbh->prepare($sql);
$numrows->bindParam(':catid', $catid);
$numrows->execute();
if ($numrows->fetchColumn() != 0) {
$sql = $zdbh->prepare($sql);
$sql->bindParam(':catid', $catid);
$res = array();
$sql->execute();
while ($row = $sql->fetch()) {
if (ctrl_groups::CheckGroupModulePermissions($user['usergroupid'], $row['mo_id_pk'])) {
array_push($res, array('mo_id_pk' => $row['mo_id_pk'], 'mo_category_fk' => $row['mo_category_fk'], 'mo_name_vc' => $row['mo_name_vc'], 'mo_version_in' => $row['mo_version_in'], 'mo_folder_vc' => $row['mo_folder_vc'], 'mo_type_en' => $row['mo_type_en'], 'mo_desc_tx' => $row['mo_desc_tx'], 'mo_installed_ts' => $row['mo_installed_ts'], 'mo_enabled_en' => $row['mo_enabled_en'], 'mo_updatever_vc' => $row['mo_updatever_vc'], 'mo_updateurl_tx' => $row['mo_updateurl_tx']));
}
}
return $res;
} else {
return false;
}
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:34,代码来源:moduleloader.class.php
示例2: Init
/**
* Get the latest requests and updates the values avaliable to the model/view.
* @author Bobby Allen ([email protected])
*/
public function Init()
{
//Set class varables
$this->vars_get = array($_GET);
$this->vars_post = array($_POST);
$this->vars_session = array($_SESSION);
$this->vars_cookie = array($_COOKIE);
//Here we get the users information
$user = ctrl_users::GetUserDetail();
if (!isset($this->vars_session[0]['zpuid'])) {
ui_module::GetLoginTemplate();
}
if (isset($this->vars_get[0]['module'])) {
ui_module::getModule($this->GetCurrentModule());
}
if (isset($this->vars_get[0]['action'])) {
if (ctrl_groups::CheckGroupModulePermissions($user['usergroupid'], ui_module::GetModuleID())) {
if (class_exists('module_controller', FALSE) && method_exists('module_controller', 'do' . $this->vars_get[0]['action'])) {
call_user_func(array('module_controller', 'do' . $this->vars_get[0]['action']));
} else {
echo ui_sysmessage::shout("No 'do" . runtime_xss::xssClean($this->vars_get[0]['action']) . "' class exists - Please create it to enable controller actions and runtime placeholders within your module.");
}
}
}
return;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:30,代码来源:controller.class.php
示例3: getConfig
static function getConfig()
{
global $zdbh;
$currentuser = ctrl_users::GetUserDetail();
$sql = "SELECT * FROM x_settings WHERE so_module_vc=:name AND so_usereditable_en = 'true' ORDER BY so_cleanname_vc";
//$numrows = $zdbh->query($sql);
$name = ui_module::GetModuleName();
$numrows = $zdbh->prepare($sql);
$numrows->bindParam(':name', $name);
$numrows->execute();
if ($numrows->fetchColumn() != 0) {
$sql = $zdbh->prepare($sql);
$sql->bindParam(':name', $name);
$res = array();
$sql->execute();
while ($rowmailsettings = $sql->fetch()) {
if (ctrl_options::CheckForPredefinedOptions($rowmailsettings['so_defvalues_tx'])) {
$fieldhtml = ctrl_options::OuputSettingMenuField($rowmailsettings['so_name_vc'], $rowmailsettings['so_defvalues_tx'], $rowmailsettings['so_value_tx']);
} else {
$fieldhtml = ctrl_options::OutputSettingTextArea($rowmailsettings['so_name_vc'], $rowmailsettings['so_value_tx']);
}
array_push($res, array('cleanname' => ui_language::translate($rowmailsettings['so_cleanname_vc']), 'name' => $rowmailsettings['so_name_vc'], 'description' => ui_language::translate($rowmailsettings['so_desc_tx']), 'value' => $rowmailsettings['so_value_tx'], 'fieldhtml' => $fieldhtml));
}
return $res;
} else {
return false;
}
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:28,代码来源:controller.ext.php
示例4: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
$bandwidthquota = $currentuser['bandwidthquota'];
$bandwidth = ctrl_users::GetQuotaUsages('bandwidth', $currentuser['userid']);
if ($bandwidthquota == 0) {
return '<div class="progress progress-striped"><div class="progress-bar progress-bar-success" style="width: 0%"></div></div>';
} else {
if (fs_director::CheckForEmptyValue($bandwidth)) {
$bandwidth = 0;
}
$percent = round($bandwidth / $bandwidthquota * 100, 0);
if ($percent >= 75) {
$bar = 'danger';
} else {
$bar = 'success';
}
if ($percent >= 10) {
$showpercent = $percent . '%';
} else {
$showpercent = '';
}
return '<div class="progress progress-striped"><div class="progress-bar progress-bar-' . $bar . '" style="width: ' . $percent . '%">' . $showpercent . '</div></div>';
}
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:25,代码来源:progbarbandwidth.class.php
示例5: translate
/**
* Used to translate a text string into the language preference of the user.
* @author Russell Skinner ([email protected])
* @global db_driver $zdbh The ZPX database handle.
* @param $message The string to translate.
* @return string The transalated string.
*/
static function translate($message)
{
global $zdbh;
$message = addslashes($message);
$currentuser = ctrl_users::GetUserDetail();
$lang = $currentuser['language'];
$column_names = self::GetColumnNames('x_translations');
foreach ($column_names as $column_name) {
$columnNameClean = $zdbh->mysqlRealEscapeString($column_name);
$sql = $zdbh->prepare("SELECT * FROM x_translations WHERE " . $columnNameClean . " LIKE :message");
$sql->bindParam(':message', $message);
$sql->execute();
$result = $sql->fetch();
if ($result) {
if (!fs_director::CheckForEmptyValue($result['tr_' . $lang . '_tx'])) {
return $result['tr_' . $lang . '_tx'];
} else {
return stripslashes($message);
}
}
}
if (!fs_director::CheckForEmptyValue($message) && $lang == "en") {
$sql = $zdbh->prepare("INSERT INTO x_translations (tr_en_tx) VALUES (:message)");
$sql->bindParam(':message', $message);
$sql->execute();
}
return stripslashes($message);
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:35,代码来源:language.class-orig.php
示例6: Template
public static function Template()
{
$active = isset($_REQUEST['module']) ? '' : 'class="active"';
$line = '<li ' . $active . '><a href="."><: Home :></a></li>';
$modcats = ui_moduleloader::GetModuleCats();
rsort($modcats);
foreach ($modcats as $modcat) {
$shortName = $modcat['mc_name_vc'];
switch ($shortName) {
case 'Account Information':
$shortName = 'Account';
break;
case 'Server Admin':
$shortName = 'Admin';
break;
case 'Database Management':
$shortName = 'Database';
break;
case 'Domain Management':
$shortName = 'Domain';
break;
case 'File Management':
$shortName = 'File';
break;
case 'Server Admin':
$shortName = 'Server';
break;
}
$shortName = '<: ' . $shortName . ' :>';
$mods = ui_moduleloader::GetModuleList($modcat['mc_id_pk']);
if (count($mods) > 0) {
$line .= '<li class="dropdown">';
// IF Account, show Gravatar Image
if ($shortName == '<: Account :>') {
$currentuser = ctrl_users::GetUserDetail();
$image = self::get_gravatar($currentuser['email'], 22, 'mm', 'g', true);
$line .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $image . ' ' . $shortName . ' <b class="caret"></b></a>';
} else {
$line .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $shortName . ' <b class="caret"></b></a>';
}
$line .= '<ul class="dropdown-menu">';
foreach ($mods as $mod) {
$class_name = str_replace(array(' ', '_'), '-', strtolower($mod['mo_folder_vc']));
if (isset($_GET['module']) && $_GET['module'] == $mod['mo_folder_vc']) {
$line .= '<li class="active">';
} else {
$line .= '<li>';
}
$line .= '<a href="?module=' . $mod['mo_folder_vc'] . '"><i class="icon-' . $class_name . '"></i> <: ' . $mod['mo_name_vc'] . ' :></a></li>';
}
// If Account tab, show Logout Menu Item
if ($shortName == '<: Account :>') {
$line .= '<li><a href="?logout"><i class="icon-phpinfo"></i> Logout</a></li>';
}
$line .= '</ul></li>';
}
}
return $line;
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:59,代码来源:modulelistznavbar.class.php
示例7: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail(ctrl_auth::CurrentUserID());
if ($currentuser['lastlogon']) {
return date(ctrl_options::GetSystemOption('sentora_df'), $currentuser['lastlogon']);
} else {
return "<: Never :>";
}
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:9,代码来源:lastlogon.class.php
示例8: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
if ($currentuser['bandwidthquota'] == 0) {
$bandwidthquota = '<: Unlimited :>';
} else {
$bandwidthquota = fs_director::ShowHumanFileSize($currentuser['bandwidthquota']);
}
return $bandwidthquota;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:10,代码来源:quotabandwidth.class.php
示例9: CheckModuleExists
/**
* Checks that the module exists.
* @author Bobby Allen ([email protected])
* @param string $name Name of the module to check that exists.
* @return boolean
*/
static function CheckModuleExists($name)
{
$user = ctrl_users::GetUserDetail();
if (file_exists("modules/" . $name . "/module.zpm")) {
if (ctrl_groups::CheckGroupModulePermissions($user['usergroupid'], self::GetModuleID())) {
return true;
}
}
return false;
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:16,代码来源:module.class.php
示例10: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
$subdomainsquota = $currentuser['subdomainquota'];
if ($subdomainsquota < 0) {
return '∞';
} else {
return $subdomainsquota;
}
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:10,代码来源:totalsubdomains.class.php
示例11: Template
public static function Template()
{
$user = ctrl_users::GetUserDetail();
if (!fs_director::CheckForEmptyValue(fs_director::CheckForEmptyValue($user['usercss']))) {
$retval = "etc/styles/" . ui_template::GetUserTemplate() . "/css/default.css";
} else {
$retval = "etc/styles/" . ui_template::GetUserTemplate() . "/css/" . $user['usercss'] . ".css";
}
return $retval;
}
开发者ID:Boter,项目名称:madmin-core,代码行数:10,代码来源:csspath.class.php
示例12: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
$forwardersquota = $currentuser['forwardersquota'];
if ($forwardersquota < 0) {
return '∞';
} else {
return $forwardersquota;
}
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:10,代码来源:totalforwarders.class.php
示例13: doUpdateMessage
static function doUpdateMessage()
{
global $controller;
runtime_csfr::Protect();
$currentuser = ctrl_users::GetUserDetail();
$formvars = $controller->GetAllControllerRequests('FORM');
self::ExectuteUpdateNotice($currentuser['userid'], $formvars['inNotice']);
header("location: ./?module=" . $controller->GetCurrentModule() . "&saved=true");
exit;
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:controller.ext.php
示例14: Template
public static function Template()
{
global $controller;
$currentuser = ctrl_users::GetUserDetail();
$domain = ctrl_users::GetUserDomains($currentuser['userid'], 3);
if ($domain != 0) {
return (string) $domain;
}
return (string) 0;
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:10,代码来源:parkeddomains.class.php
示例15: GetUserTemplate
/**
* Returns the name (folder name) of the template that should be used for the current user.
* @author Bobby Allen ([email protected])
* @return string The template name.
*/
static function GetUserTemplate()
{
$user = ctrl_users::GetUserDetail();
if (fs_director::CheckForEmptyValue($user['usertheme'])) {
# Lets use the reseller's theme they have setup!
$reseller = ctrl_users::GetUserDetail($user['resellerid']);
return $reseller['usertheme'];
} else {
return $user['usertheme'];
}
}
开发者ID:Boter,项目名称:madmin-core,代码行数:16,代码来源:template.class.php
示例16: getReportToShow
static function getReportToShow()
{
global $controller;
$urlvars = $controller->GetAllControllerRequests('URL');
if (isset($urlvars['domain']) && $urlvars['domain'] != "") {
$currentuser = ctrl_users::GetUserDetail();
$report_to_show = "modules/webalizer_stats/stats/" . $currentuser['username'] . "/" . $urlvars['domain'] . "/index.html";
if (!file_exists($report_to_show)) {
$report_to_show = false;
}
return $report_to_show;
}
}
开发者ID:TGates71,项目名称:Sentora-Windows-Upgrade,代码行数:13,代码来源:controller.ext.php
示例17: Template
public static function Template()
{
global $zdbh;
$currentuser = ctrl_users::GetUserDetail();
$user = $currentuser;
$domain_limit = 4;
/* Domains */
$line = self::getDomains('domain', $domain_limit, $currentuser, $zdbh);
/* Sub Domains */
$line .= self::getDomains('subdomain', $domain_limit, $currentuser, $zdbh);
/* Parked Domains */
$line .= self::getDomains('parkeddomain', $domain_limit, $currentuser, $zdbh);
return $line;
}
开发者ID:BIGGANI,项目名称:zpanelx,代码行数:14,代码来源:clientdomains.class.php
示例18: Template
public static function Template()
{
$user_array = ctrl_users::GetUserDetail();
global $zdbh;
$result = $zdbh->query("SELECT ac_notice_tx FROM x_accounts WHERE ac_id_pk = " . $user_array['resellerid'] . "")->Fetch();
if ($result) {
if ($result['ac_notice_tx'] != "") {
return ui_sysmessage::shout(runtime_xss::xssClean($result['ac_notice_tx']), 'notice', 'Notice:', true);
}
return false;
} else {
return false;
}
}
开发者ID:Boter,项目名称:madmin-core,代码行数:14,代码来源:notice.class.php
示例19: doUpdatePassword
static function doUpdatePassword()
{
global $zdbh;
global $controller;
runtime_csfr::Protect();
$currentuser = ctrl_users::GetUserDetail();
$current_pass = $controller->GetControllerRequest('FORM', 'inCurPass');
$newpass = $controller->GetControllerRequest('FORM', 'inNewPass');
$conpass = $controller->GetControllerRequest('FORM', 'inConPass');
$crypto = new runtime_hash();
$crypto->SetPassword($newpass);
$randomsalt = $crypto->RandomSalt();
$crypto->SetSalt($randomsalt);
$new_secure_password = $crypto->CryptParts($crypto->Crypt())->Hash;
$sql = $zdbh->prepare("SELECT ac_pass_vc, ac_passsalt_vc FROM x_accounts WHERE ac_id_pk= :uid");
$sql->bindParam(':uid', $currentuser['userid']);
$sql->execute();
$result = $sql->fetch();
$userpasshash = new runtime_hash();
$userpasshash->SetPassword($current_pass);
$userpasshash->SetSalt($result['ac_passsalt_vc']);
$current_secure_password = $userpasshash->CryptParts($userpasshash->Crypt())->Hash;
if (fs_director::CheckForEmptyValue($newpass)) {
// Current password is blank!
self::$error = "error";
} elseif ($current_secure_password != $result['ac_pass_vc']) {
// Current password does not match!
self::$error = "nomatch";
} else {
if ($newpass == $conpass) {
// Check for password length...
if (strlen($newpass) < ctrl_options::GetSystemOption('password_minlength')) {
self::$badpassword = true;
return false;
}
// Check that the new password matches the confirmation box.
$sql = $zdbh->prepare("UPDATE x_accounts SET ac_pass_vc=:new_secure_password, ac_passsalt_vc= :randomsalt WHERE ac_id_pk=:userid");
$sql->bindParam(':randomsalt', $randomsalt);
$sql->bindParam(':new_secure_password', $new_secure_password);
$sql->bindParam(':userid', $currentuser['userid']);
$sql->execute();
self::$error = "ok";
} else {
self::$error = "error";
}
}
}
开发者ID:Boter,项目名称:madmin-core,代码行数:47,代码来源:controller.ext.php
示例20: ExecuteUpdateAccountSettings
static function ExecuteUpdateAccountSettings($userid, $email, $fullname, $language, $phone, $address, $postalCode)
{
global $zdbh;
$email = strtolower(str_replace(' ', '', $email));
$fullname = ucwords($fullname);
if (fs_director::CheckForEmptyValue(self::CheckUpdateForErrors($email, $fullname, $language, $phone, $address, $postalCode))) {
return false;
}
$currentuser = ctrl_users::GetUserDetail();
$sql = $zdbh->prepare("UPDATE x_accounts SET ac_email_vc = :email WHERE ac_id_pk = :userid");
$sql->bindParam(':email', $email);
$sql->bindParam(':userid', $userid);
$sql->execute();
$sql = $zdbh->prepare("UPDATE x_profiles SET ud_fullname_vc = :fullname, ud_language_vc = :language, ud_phone_vc = :phone, ud_address_tx = :address, ud_postcode_vc = :postcode WHERE ud_user_fk = :userid");
$sql->bindParam(':fullname', $fullname);
$sql->bindParam(':language', $language);
$sql->bindParam(':phone', $phone);
$sql->bindParam(':address', $address);
$sql->bindParam(':postcode', $postalCode);
$sql->bindParam(':userid', $userid);
$sql->execute();
return true;
}
开发者ID:bbspike,项目名称:sentora-core,代码行数:23,代码来源:controller.ext.php
注:本文中的ctrl_users类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论