本文整理汇总了PHP中Rights::getTotalRights方法的典型用法代码示例。如果您正苦于以下问题:PHP Rights::getTotalRights方法的具体用法?PHP Rights::getTotalRights怎么用?PHP Rights::getTotalRights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rights
的用法示例。
在下文中一共展示了Rights::getTotalRights方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rename
}
if (file_exists($ci->getFilenameOnDisk(FALSE, TRUE))) {
rename($ci->getFilenameOnDisk(FALSE, TRUE), $ci->getFilenameOnDisk(FALSE, FALSE));
}
} else {
if (file_exists($ci->getFilenameOnDisk(TRUE))) {
rename($ci->getFilenameOnDisk(TRUE), $ci->getFilenameOnDisk(FALSE));
}
}
}
/* Give the admin-user full rights */
$admUser = User::GetUsers(new UserSearchParameters(CMDLINE_USERID));
/* @var $admUser User */
if ($admUser) {
$admUser = $admUser[0];
$admUser->setRights(Rights::getTotalRights());
User::Update($admUser, $admUser);
}
/* Introduce CANDYPATH constant and write to config */
if (defined('CANDYIMAGEPATH') && !defined('CANDYPATH')) {
if (($configfile = file_get_contents('config.php')) !== FALSE) {
$configfile = str_replace('CANDYIMAGEPATH', 'CANDYPATH', $configfile);
if (file_put_contents('config.php', $configfile) === FALSE) {
$e = new Error(NULL, $lang->g('ErrorSetupWritingConfig'));
Error::AddError($e);
$NoError = FALSE;
}
} else {
$e = new Error(NULL, $lang->g('ErrorSetupWritingConfig'));
Error::AddError($e);
$NoError = FALSE;
示例2: isset
$SmtpHostname = isset($_POST['txtSmtpHostname']) && strlen($_POST['txtSmtpHostname']) > 0 ? (string) $_POST['txtSmtpHostname'] : NULL;
$SmtpUsername = isset($_POST['txtSmtpUsername']) && strlen($_POST['txtSmtpUsername']) > 0 ? (string) $_POST['txtSmtpUsername'] : NULL;
$SmtpPassword = isset($_POST['txtSmtpPassword']) && strlen($_POST['txtSmtpPassword']) > 0 ? (string) $_POST['txtSmtpPassword'] : NULL;
$SmtpPort = isset($_POST['txtSmtpPort']) && intval($_POST['txtSmtpPort']) > 0 ? intval($_POST['txtSmtpPort']) : 0;
$SmtpAuth = array_key_exists('chkSmtpAuth', $_POST);
$PasswordOK = $_POST['txtRepeatPassword'] == $_POST['txtPassword'];
$EmailOK = Utils::ValidateEmail($UserEmail);
$DBsettingsSet = isset($DBHostName) && isset($DBUserName) && isset($DBPassword);
if ($PasswordOK && $EmailOK && $DBsettingsSet) {
/* @var $dbi DBi */
if (@($dbi = new DBi($DBHostName, $DBUserName, $DBPassword, 'mysql'))) {
$DBConnectOK = $dbi->connect_errno == 0;
if ($DBConnectOK) {
if ($dbi->ExecuteMulti(sprintf($CreateDBSQL, $dbi->real_escape_string($DBName)))) {
$UserSalt = Utils::GenerateGarbage(20);
if ($dbi->query(sprintf($InsertUserSQL, $dbi->real_escape_string($UserName), $dbi->real_escape_string(Utils::HashString($Password, $UserSalt)), $dbi->real_escape_string($UserSalt), $dbi->real_escape_string($UserFirstName), $dbi->real_escape_string($UserLastName), $dbi->real_escape_string($UserEmail), $dbi->real_escape_string(serialize(Rights::getTotalRights()))))) {
$NewUserID = $dbi->insert_id;
$NewConfig = sprintf($ConfigTemplate, str_ireplace('\\', '\\\\', $CandyPath), str_ireplace('\\', '\\\\', $CandyVideoThumbPath), $DBHostName, $DBUserName, $DBPassword, $DBName, $NewUserID, $SmtpFromAddress, $SmtpFromName, $SmtpHostname, $SmtpUsername, $SmtpPassword, $SmtpPort, $SmtpAuth ? 'TRUE' : 'FALSE', $UserFirstName, $UserLastName);
if (@file_put_contents('config.php', $NewConfig, LOCK_EX) !== FALSE) {
if (is_dir('cache') || mkdir('cache', 0700, TRUE)) {
$i = new Info($lang->g('MessageAllDoneConfigWritten'));
Info::AddInfo($i);
header('location:login.php');
exit;
} else {
$e = new Error(NULL, $lang->g('ErrorSetupCreatingCacheDir'));
Error::AddError($e);
}
} else {
$e = new Error(NULL, $lang->g('ErrorSetupWritingConfig'));
Error::AddError($e);