本文整理汇总了PHP中fs_director类的典型用法代码示例。如果您正苦于以下问题:PHP fs_director类的具体用法?PHP fs_director怎么用?PHP fs_director使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了fs_director类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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>';
}
}
示例2: DeleteApacheClientFiles
function DeleteApacheClientFiles()
{
global $zdbh;
$sql = "SELECT * FROM x_accounts WHERE ac_deleted_ts IS NOT NULL";
$numrows = $zdbh->query($sql);
if ($numrows->fetchColumn() != 0) {
$sql = $zdbh->prepare($sql);
$res = array();
$sql->execute();
while ($rowdeletedaccounts = $sql->fetch()) {
// Check for an active user with same username
$sql2 = "SELECT COUNT(*) FROM x_accounts WHERE ac_user_vc=:user AND ac_deleted_ts IS NULL";
$numrows2 = $zdbh->prepare($sql2);
$user = $rowdeletedaccounts['ac_user_vc'];
$numrows2->bindParam(':user', $user);
if ($numrows2->execute()) {
if ($numrows2->fetchColumn() == 0) {
if (file_exists(ctrl_options::GetSystemOption('hosted_dir') . $rowdeletedaccounts['ac_user_vc'])) {
fs_director::RemoveDirectory(ctrl_options::GetSystemOption('hosted_dir') . $rowdeletedaccounts['ac_user_vc']);
}
}
}
}
}
}
示例3: translate
/**
* Used to translate a text string into the language preference of the user.
* @author Russell Skinner (rskinner@zpanelcp.com)
* @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);
}
示例4: Template
public static function Template()
{
if (!fs_director::CheckForEmptyValue(ctrl_options::GetSystemOption('server_ip'))) {
return ctrl_options::GetSystemOption('server_ip');
} else {
return sys_monitoring::ServerIPAddress();
}
}
示例5: getDomains
static function getDomains()
{
$currentuser = ctrl_users::GetUserDetail();
$clientlist = self::ListDomains($currentuser['userid']);
if (!fs_director::CheckForEmptyValue($clientlist)) {
return $clientlist;
} else {
return false;
}
}
示例6: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
if ($currentuser['bandwidthquota'] == 0) {
$bandwidthquota = '<: Unlimited :>';
} else {
$bandwidthquota = fs_director::ShowHumanFileSize($currentuser['bandwidthquota']);
}
return $bandwidthquota;
}
示例7: 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;
}
示例8: GetUserTemplate
/**
* Returns the name (folder name) of the template that should be used for the current user.
* @author Bobby Allen (ballen@bobbyallen.me)
* @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'];
}
}
示例9: GetDomainsForUser
/**
* Gets a list of all the domains that a user has configured on their hosting account (the user id needs to be sent in the <content> tag).
* @global type $zdbh
* @return type
*/
public function GetDomainsForUser()
{
global $zdbh;
$request_data = $this->RawXMWSToArray($this->wsdata);
$response_xml = "\n";
$alldomains = module_controller::ListDomains($request_data['content']);
if (!fs_director::CheckForEmptyValue($alldomains)) {
foreach ($alldomains as $domain) {
$response_xml = $response_xml . ws_xmws::NewXMLContentSection('domain', array('id' => $domain['id'], 'uid' => $domain['uid'], 'domain' => $domain['name'], 'homedirectory' => $domain['directory'], 'active' => $domain['active']));
}
}
$dataobject = new runtime_dataobject();
$dataobject->addItemValue('response', '');
$dataobject->addItemValue('content', $response_xml);
return $dataobject->getDataObject();
}
示例10: getServices
public static function getServices()
{
global $controller;
if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/up.gif') && file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/down.gif')) {
$iconpath = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
} else {
$iconpath = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/';
}
$line = "<h2>" . ui_language::translate("Checking status of services...") . "</h2>";
$line .= "<table>";
$status = fs_director::CheckForEmptyValue(sys_monitoring::PortStatus($PortNum));
$line .= '<tr><th>HTTP</th><td>' . module_controller::status_port(80, $iconpath) . '</td></tr>';
$line .= '<tr><th>FTP</th><td>' . module_controller::status_port(21, $iconpath) . '</td></tr>';
$line .= '<tr><th>SMTP</th><td>' . module_controller::status_port(25, $iconpath) . '</td></tr>';
$line .= '<tr><th>POP3</th><td>' . module_controller::status_port(110, $iconpath) . '</td></tr>';
$line .= '<tr><th>IMAP</th><td>' . module_controller::status_port(143, $iconpath) . '</td></tr>';
$line .= '<tr><th>MySQL</th><td>' . module_controller::status_port(3306, $iconpath) . '</td></tr>';
$line .= '<tr><th>DNS</th><td>' . module_controller::status_port(53, $iconpath) . '</td></tr>';
$line .= '</table>';
$line .= '<br><h2>' . ui_language::translate('Server Uptime') . '</h2>';
$line .= ui_language::translate('Uptime') . ": " . sys_monitoring::ServerUptime();
return $line;
}
示例11: translate
/**
* Used to translate a text string into the language preference of the user.
* @author Pascal Peyremorte (p.peyremorte@wanadoo.fr)
* @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;
if (empty(self::$LangCol)) {
$uid = ctrl_auth::CurrentUserID();
$sql = $zdbh->prepare('SELECT ud_language_vc FROM x_profiles WHERE ud_user_fk=' . $uid);
$sql->execute();
$lang = $sql->fetch();
self::$LangCol = 'tr_' . $lang['ud_language_vc'] . '_tx';
}
if (self::$LangCol == 'tr_en_tx') {
return $message;
}
//no translation required, english used
$SlashedMessage = addslashes($message);
//protect special chars
$sql = $zdbh->prepare('SELECT ' . self::$LangCol . ' FROM x_translations WHERE tr_en_tx =:message');
$sql->bindParam(':message', $SlashedMessage);
$sql->execute();
$result = $sql->fetch();
if ($result) {
if (!fs_director::CheckForEmptyValue($result[self::$LangCol])) {
return $result[self::$LangCol];
} else {
return $message;
}
//translated message empty
} else {
//message not found in the table
//add unfound message to the table with empties translations
$sql = $zdbh->prepare('INSERT INTO x_translations SET tr_en_tx=:message');
$sql->bindParam(':message', $SlashedMessage);
$sql->execute();
return $message;
}
}
示例12: Template
public static function Template()
{
$currentuser = ctrl_users::GetUserDetail();
return fs_director::ShowHumanFileSize(ctrl_users::GetQuotaUsages('diskspace', $currentuser['userid']));
}
示例13: UpdateFile
/**
* Updates an existing file and will chmod it too if required.
* @author Bobby Allen (ballen@bobbyallen.me)
* @param string $path The path and file name to the file to update.
* @param string $chmod Permissions mode to use for the new file. (eg. 0777)
* @param string $sting The content to update the file with.
* @return boolean
*/
static function UpdateFile($path, $chmod = 0777, $string = "")
{
if (!file_exists($path)) {
fs_filehandler::ResetFile($path);
}
$fp = @fopen($path, 'w');
@fwrite($fp, $string);
@fclose($fp);
fs_director::SetFileSystemPermissions($path, $chmod);
return true;
}
示例14: getResult
static function getResult()
{
if (!fs_director::CheckForEmptyValue(self::$blank)) {
return ui_sysmessage::shout(ui_language::translate("You must enter a valid username and password to create your FTP account."), "zannounceerror");
}
if (!fs_director::CheckForEmptyValue(self::$alreadyexists)) {
return ui_sysmessage::shout(ui_language::translate("An FTP account with that name already exists."), "zannounceerror");
}
if (!fs_director::CheckForEmptyValue(self::$error)) {
return ui_sysmessage::shout(ui_language::translate("There was an error updating your FTP accounts."), "zannounceerror");
}
if (!fs_director::CheckForEmptyValue(self::$badname)) {
return ui_sysmessage::shout(ui_language::translate("Your ftp account name is not valid. Please enter a valid ftp account name."), "zannounceerror");
}
if (!fs_director::CheckForEmptyValue(self::$invalidPath)) {
return ui_sysmessage::shout(ui_language::translate("Invalid Folder."), "zannounceok");
}
if (!fs_director::CheckForEmptyValue(self::$ok)) {
return ui_sysmessage::shout(ui_language::translate("FTP accounts updated successfully."), "zannounceok");
}
return;
}
示例15: fileExists
static function fileExists($combinedPath)
{
if (!fs_director::CheckFileExists($combinedPath)) {
self::setFlashMessage('debug', 'file does not exist');
return false;
}
self::setFlashMessage('debug', 'file exists');
return true;
}