本文整理汇总了PHP中Admin类的典型用法代码示例。如果您正苦于以下问题:PHP Admin类的具体用法?PHP Admin怎么用?PHP Admin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Admin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$lang = $this->_request->getParam('lang');
$langNamespace = new Zend_Session_Namespace('Lang');
$langNamespace->lang = $lang;
// Zend_Debug::dump($_SERVER["HTTP_REFERER"]);
if (isset($this->_currentUser->id)) {
$consumerModel = new Consumer();
$consumer = $consumerModel->fetchRow('id = ' . $this->_currentUser->id);
if ($consumer != null) {
$consumer->language_pref = $lang;
$consumer->save();
} else {
$adminModel = new Admin();
$admin = $adminModel->fetchRow('id = ' . $this->_currentUser->id);
if ($admin != null) {
$admin->language_pref = $lang;
$admin->save();
}
}
}
$messageArray = $this->_flashMessenger->getMessages();
if ($messageArray != null) {
foreach ($messageArray as $message) {
$this->_flashMessenger->addMessage($message);
}
}
$this->_helper->redirector->gotoUrl($_SERVER["HTTP_REFERER"]);
}
示例2: adminLogin
function adminLogin()
{
$reservename = getvar('username', 'post');
$pass = getvar('pass', 'post');
if (strlen($reservename) >= 5 && strlen($pass) > 5) {
$admin = new Admin();
$row = $admin->findOne($reservename, md5($pass));
if ($row) {
setvar('admin', $row['username']);
//session
if (getvar('rememberme', 'post')) {
setcookie('username', $reservename, time() + 3600 * 24 * 7);
}
//账号默认保存七天
setHint('欢迎管理员');
redirect('usershow');
} else {
setHint('账号或密码有误');
redirect('login');
}
} else {
setHint('账号或密码不符合要求');
redirect('login');
}
}
示例3: testEndreUgyldigKunde
public function testEndreUgyldigKunde()
{
//Arrange
$admin = new Admin(new adminDBStubSqlite());
$kunde = new kunde();
$kunde->personnummer = "11122233312";
$kunde->fornavn = "Ugyldig";
$kunde->etternavn = "Person";
$kunde->adresse = "Luftslåttveien 22";
$kunde->postnr = "1387";
$kunde->poststed = "Asker";
$kunde->telefonnr = "22224444";
$kunde->passord = "11122233312";
//Act
$OK = $admin->hentKundeInfo($kunde->personnummer);
$this->assertEquals("Feil", $OK);
$oppdatertKunde = clone $kunde;
$oppdatertKunde->fornavn = "Lina";
$oppdatertKunde->etternavn = "Jonvik";
$oppdatertKunde->adresse = "Slaskebakken 22";
$OK = $admin->endreKundeInfo($oppdatertKunde);
$this->assertEquals("OK", $OK);
$OK = $admin->hentKundeInfo($kunde->personnummer);
$this->assertEquals("Feil", $OK);
}
示例4: indexAction
public function indexAction()
{
$fc = FrontController::getInstance();
$admin = new Admin();
$output = $admin->render(ADMIN_TEMPLATE, ADMIN_LOGIN);
$fc->setBody($output);
}
示例5: AdminEkle
function AdminEkle(Admin $admin)
{
try {
$sorgu = "insert into admin (username, ad, soyad, email, tel, dogumTarihi) values(?,?,?,?,?,?)";
$admindeger = array($admin->getUsername(), $admin->getAd(), $admin->getSoyad(), $admin->getEmail(), $admin->getTel(), $admin->getDogumTarihi());
$baglanti = new VeriTabaniBaglanti();
$conn = $baglanti->pdo_baglanti();
$ekle = $conn->prepare($sorgu);
$sonuc = $ekle->execute($admindeger);
if ($sonuc) {
$kul = new KullaniciGiris();
$kuldao = new KullaniciGirisDAO();
$sifre = $admin->getAd() . $admin->getSoyad();
$yeniSifre = $kuldao->sifreleme($sifre);
$kul->setEmail($admin->getEmail());
$kul->setSifre($yeniSifre);
$kul->setYetkiId(1);
echo '<p style="color: green;">Veriler Eklendi</p>';
echo $kuldao->KullaniciEkle($kul);
} else {
echo '<p style="color: red;">Hata Oluştu</p>';
}
} catch (PDOException $exc) {
echo $exc->getTraceAsString();
}
}
示例6: getSessionInfo
public function getSessionInfo()
{
$email = $this->getSession("email");
$admin = new Admin();
$datainfo = $admin->getUserByEmail($email);
return $datainfo;
}
示例7: actionDrugSets
/**
* Render the basic drug set admin page.
*/
public function actionDrugSets()
{
$admin = new Admin(DrugSet::model(), $this);
$admin->setListFields(array('id', 'name', 'subspecialty.name', 'active'));
$admin->searchAll();
$admin->getSearch()->setItemsPerPage($this->itemsPerPage);
$admin->listModel();
}
示例8: delete
function delete()
{
$this->is_loggedin();
global $runtime;
$to_trash = new Admin($runtime['ident']);
$to_trash->delete();
redirect('admin/all');
}
示例9: test_slettKonto_FEIL
function test_slettKonto_FEIL()
{
$adminLogikk = new Admin(new AdminDBStub());
$konto = new konto();
$konto->kontonummer = 123;
$OK = $adminLogikk->slettKonto($konto->kontonummer);
$this->assertEquals("OK", $OK);
}
示例10: testIsAdmin
public function testIsAdmin()
{
$admin = new Admin();
$admin->add_admin('toto');
$admins = $admin->get_admins();
$this->assertTrue($admin->is_admin('toto'));
$admin->remove_admin('toto');
}
示例11: valid
public function valid(Admin $admin)
{
$sql = 'INSERT INTO `' . $this->table . '` (`id`, `first_name`, `last_name`, `email`, `login`, `password`, `heurisko`, `language`)
VALUES (:id, :first_name, :last_name, :email, :login, :password, :heurisko, :language)
ON DUPLICATE KEY UPDATE
first_name=:first_name, last_name=:last_name, email=:email, login=:login, password=:password, heurisko=:heurisko, language=:language';
return $this->execute($sql, null, array(array(':id', $admin->id, PDO::PARAM_INT), array(':first_name', $admin->first_name, PDO::PARAM_STR), array(':last_name', $admin->last_name, PDO::PARAM_STR), array(':email', $admin->email, PDO::PARAM_STR), array(':login', $admin->login, PDO::PARAM_STR), array(':password', $admin->password, PDO::PARAM_STR), array(':heurisko', $admin->isHeurisko(), PDO::PARAM_BOOL), array(':language', $admin->getLanguageId(), PDO::PARAM_INT)));
}
示例12: loadModule
function loadModule()
{
$module = $this->httpRequest->getModule();
$GLOBALS['Plugin'] = null;
if (strpos($module, 'AdminPanel') === 0) {
$pluginFolderName = strtolower(substr($module, 10));
# Be carful, here parameters are moved
$module = $this->httpRequest->getAction();
if ($module == null) {
throw new Exception(__('No module'));
}
$moduleFilePath = DIR_PLUGINS . $pluginFolderName . '/actions/' . $module . '.class.php';
# Include admin module
if (file_exists($moduleFilePath)) {
require_once $moduleFilePath;
$moduleController = new $module();
} else {
throw new Exception(__('No file found'));
}
# Get the action (Prob: HttpRequest->parseUrl() don't parse the second string following '/' )
ereg($this->httpRequest->getModule() . '/' . $module . '/([^\\?$]+)', $_SERVER['REQUEST_URI'], $res);
if (isset($res[1])) {
$action = $res[1];
} else {
throw new Exception(__('No action'));
}
# if method exist call it
if (method_exists($moduleController, $action)) {
# search parameters method
$reflect = new ReflectionMethod($module, $action);
$parameters = $reflect->getParameters();
$tabParam = array();
foreach ($parameters as $param) {
$tabParam[$param->getName()] = $this->httpRequest->getArgument($param->getName());
}
try {
$pluginsInfoList = Plugin::getManifest($pluginFolderName);
$name = $pluginsInfoList['name'];
define('PLUGIN_ITSELF_URL_BASE', BASE_PORTAL_URI . 'index.php/' . $this->httpRequest->getModule() . '/');
ob_start();
//echo Plugin::getHeader($name);
# Call action of the plugin
call_user_func_array(array(new $module(), $action), $tabParam);
$GLOBALS['Plugin']['pluginViewContent'] = ob_get_clean();
} catch (Exception $e) {
echo $e->getMessage();
}
} else {
throw new Exception(__("No action"));
}
$GLOBALS['Plugin']['comingFromPlugin'] = true;
$adminController = new Admin();
$adminController->index();
} else {
parent::loadModule();
}
}
示例13: Admin
/**
* @expectedException PDOException
* @expectedExceptionCode 23000
* @expectedExceptionMessage Integrity constraint violation: 19 NOT NULL constraint failed: Konto.Kontonummer
*
*/
public function testRegistrereUgyldigKontoPåGyldigKunde()
{
//Arrange
$admin = new Admin(new adminDBStubSqlite());
$konto = new konto();
$konto->personnummer = "09048433711";
//Act
$OK = $admin->registrerKonto($konto);
}
示例14: checkAdminPermissions
public function checkAdminPermissions(Admin $admin)
{
foreach (array(Am_Auth_Admin::PERM_LOGS, Am_Auth_Admin::PERM_LOGS_ACCESS, Am_Auth_Admin::PERM_LOGS_INVOICE, Am_Auth_Admin::PERM_LOGS_MAIL, Am_Auth_Admin::PERM_LOGS_ADMIN) as $perm) {
if ($admin->hasPermission($perm)) {
return true;
}
}
return false;
}
示例15: login
public function login()
{
$this->modelo('AdminDAO');
$admin = new Admin();
$admin->setEmail($_REQUEST['email']);
$admin->setSenha($_REQUEST['senha']);
$objAdmin = $this->AdminDAO->login($admin);
$this->visao->render('admin/painel');
}