本文整理汇总了PHP中CUser::getAcronym方法的典型用法代码示例。如果您正苦于以下问题:PHP CUser::getAcronym方法的具体用法?PHP CUser::getAcronym怎么用?PHP CUser::getAcronym使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::getAcronym方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CUser
<?php
/**
* This is a Branax pagecontroller.
*
*/
// Include the essential config-file which also creates the $branax variable with its defaults.
include __DIR__ . '/config.php';
// Create the user object
$user = new CUser($branax['database']);
// Check if user is authenticated.
$output = $user->isAuthenticated() ? "Du är inloggad som: {$user->getAcronym()} ({$user->getName()})" : "Du är INTE inloggad.";
// Check if user and password is okey and login the user
if (isset($_POST['login'])) {
$user->login($_POST['acronym'], $_POST['password']);
header('Location: user_status.php');
}
// Do it and store it all in variables in the Branax container.
$branax['title'] = "Login";
$branax['main'] = <<<EOD
<h1>{$branax['title']}</h1>
<form method=post>
<fieldset>
<legend>Login</legend>
<p><label>Användare:<br/><input type='text' name='acronym' value=''/></label></p>
<p><label>Lösenord:<br/><input type='password' name='password' value=''/></label></p>
<p><input type='submit' name='login' value='Login'/></p>
<p><a href='user_logout.php'>Logout</a></p>
<p><a href='user_register.php'>Skapa ny användare</a></p>
<output><b>{$output}</b></output>
示例2: CUser
<?php
/**
* This is a Branax pagecontroller.
*
*/
// Include the essential config-file which also creates the $branax variable with its defaults.
include __DIR__ . '/config.php';
$user = new CUser($branax['database']);
$user->isAuthenticated() or die('Check: You must login to edit.');
$content = new CContent($branax['database']);
// Do it and store it all in variables in the Anax container.
$branax['title'] = "Lägg till";
$branax['main'] = <<<EOD
<h1>Lägg till nytt innehåll</h1>
{$content->create($user->getAcronym())}
EOD;
// Finally, leave it all to the rendering phase of Anax.
include BRANAX_THEME_PATH;
示例3: CUser
<?php
/**
* This is a Branax pagecontroller.
*
*/
// Include the essential config-file which also creates the $branax variable with its defaults.
include __DIR__ . '/config.php';
// Create the user object
$user = new CUser($branax['database']);
// Check if logged in user
$admin = $user->isAdmin() ? 'med administratörsrättigheter' : null;
$output = $user->isUser() ? "Du är inloggad som {$user->getAcronym()} ({$user->getName()}) {$admin}" : "Du är INTE inloggad.";
// Do it and store it all in variables in the Anax container.
$branax['title'] = "User status";
$branax['main'] = <<<EOD
<h1>{$branax['title']}</h1>
<form method=post>
<fieldset>
<legend>Login status</legend>
<output><b>{$output}</b></output>
<p><a href='user_login.php'>Login</a></p>
<p><a href='user_logout.php'>Logout</a></p>
</fieldset>
</form>
EOD;
// Finally, leave it all to the rendering phase of Branax.
include BRANAX_THEME_PATH;