• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Admin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Admin的典型用法代码示例。如果您正苦于以下问题:PHP Admin类的具体用法?PHP Admin怎么用?PHP Admin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Admin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"]);
 }
开发者ID:omusico,项目名称:wildfire_php,代码行数:29,代码来源:LanguageController.php


示例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');
    }
}
开发者ID:jinghuizhai,项目名称:weixin,代码行数:25,代码来源:handle.php


示例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);
 }
开发者ID:kringon,项目名称:scotch-box,代码行数:25,代码来源:endreKundeInfoTest.php


示例4: indexAction

 public function indexAction()
 {
     $fc = FrontController::getInstance();
     $admin = new Admin();
     $output = $admin->render(ADMIN_TEMPLATE, ADMIN_LOGIN);
     $fc->setBody($output);
 }
开发者ID:TimaVox,项目名称:First-MVC,代码行数:7,代码来源:AdminController.php


示例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();
     }
 }
开发者ID:ufukpalavar52,项目名称:dis_klinigi_randevu_sistemi,代码行数:26,代码来源:adminDAO.php


示例6: getSessionInfo

 public function getSessionInfo()
 {
     $email = $this->getSession("email");
     $admin = new Admin();
     $datainfo = $admin->getUserByEmail($email);
     return $datainfo;
 }
开发者ID:SoufianeAr,项目名称:lmpe.com,代码行数:7,代码来源:Session.php


示例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();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:11,代码来源:DrugSetAdminController.php


示例8: delete

 function delete()
 {
     $this->is_loggedin();
     global $runtime;
     $to_trash = new Admin($runtime['ident']);
     $to_trash->delete();
     redirect('admin/all');
 }
开发者ID:stas,项目名称:bebuntu,代码行数:8,代码来源:admin-controller.php


示例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);
 }
开发者ID:jonms90,项目名称:PHPTest,代码行数:8,代码来源:hentKontoTest.php


示例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');
 }
开发者ID:JulienUsson,项目名称:ZZTask,代码行数:8,代码来源:adminTest.php


示例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)));
 }
开发者ID:ben33,项目名称:framework,代码行数:8,代码来源:AdminsDB.php


示例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();
     }
 }
开发者ID:ripplecrpht,项目名称:ripplecrpht,代码行数:57,代码来源:AdminEnabledDefaultFC.class.php


示例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);
 }
开发者ID:kringon,项目名称:scotch-box,代码行数:15,代码来源:registrerKontoTest.php


示例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;
 }
开发者ID:alexanderTsig,项目名称:arabic,代码行数:9,代码来源:AdminLogsController.php


示例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');
 }
开发者ID:prof-edson-melo,项目名称:php,代码行数:9,代码来源:AdminControle.php


示例16: saveUser

 public function saveUser(Admin $user)
 {
     $userData = $user->getArrayData();
     if ($this->getUser($user->uid) == NULL) {
         // SI NO EXISTE EL USUARIO
         $this->tableGateway->insert($userData);
     } else {
         $this->tableGateway->update($userData, array('UID' => $user->uid));
     }
 }
开发者ID:rodrigogk87,项目名称:djme,代码行数:10,代码来源:GAdminTable.php


示例17: actionEdit

 /**
  * Edits or adds a Procedure.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(UniqueCodes::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setModelDisplayName('Unique Codes');
     $admin->setEditFields(array('code' => 'label', 'active' => 'checkbox'));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:17,代码来源:UniqueCodesController.php


示例18: testSlettUgyldigKunde

 public function testSlettUgyldigKunde()
 {
     //Arrange
     $admin = new Admin(new adminDBStubSqlite());
     $personnummer = "987654321";
     //Act
     $OK = $admin->slettKunde($personnummer);
     //Assert
     $this->assertEquals("Feil", $OK);
 }
开发者ID:kringon,项目名称:scotch-box,代码行数:10,代码来源:slettKundeTest.php


示例19: testRegistrereTomKunde

 /**
  * @expectedException PDOException
  * @expectedExceptionCode 23000
  * @expectedExceptionMessage Integrity constraint violation: 19 NOT NULL constraint failed: Poststed.Postnr
  *
  */
 public function testRegistrereTomKunde()
 {
     //Arrange
     $admin = new Admin(new adminDBStubSqlite());
     $kunde = new kunde();
     //Act (Assert is in comments above)
     //Act
     $OK = $admin->registrerKunde($kunde);
     //@codeCoverageIgnoreStart
 }
开发者ID:kringon,项目名称:scotch-box,代码行数:16,代码来源:registrerKundeTest.php


示例20: authenticate

 function authenticate()
 {
     $admin = new Admin();
     $user = $admin->findUser($this->username);
     if ($user && $user->password == $this->password) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:lggorman,项目名称:mini-cms,代码行数:10,代码来源:class-user.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AdminAction类代码示例发布时间:2022-05-23
下一篇:
PHP Adherent类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap