当前位置: 首页>>代码示例>>PHP>>正文


PHP CUser::getAcronym方法代码示例

本文整理汇总了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>
开发者ID:britec,项目名称:branac-base,代码行数:31,代码来源:user_login.php

示例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;
开发者ID:britec,项目名称:branac-base,代码行数:19,代码来源:content_create.php

示例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;
开发者ID:britec,项目名称:branac-base,代码行数:29,代码来源:user_status.php


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