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


PHP Admin::delete方法代码示例

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


在下文中一共展示了Admin::delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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

示例2: array

if (!isset($_SESSION['ITCLoggedInAdmin']) || !isset($_SESSION["ITCadminEmail"])) {
    $json = array("status" => 0, "msg" => "You are not logged in.");
    header('Content-type: application/json');
    echo json_encode($json);
} else {
    if (filter_input(INPUT_POST, "deleteThisAdmin") != NULL) {
        $postVars = array('id');
        // Form fields names
        //Validate the POST variables and add up to error message if empty
        foreach ($postVars as $postVar) {
            switch ($postVar) {
                default:
                    $adminObj->{$postVar} = filter_input(INPUT_POST, $postVar) ? mysqli_real_escape_string($dbObj->connection, filter_input(INPUT_POST, $postVar)) : '';
                    if ($adminObj->{$postVar} === "") {
                        array_push($errorArr, "Please enter {$postVar} ");
                    }
                    break;
            }
        }
        //If validated and not empty submit it to database
        if (count($errorArr) < 1) {
            echo $adminObj->delete();
        } else {
            $json = array("status" => 0, "msg" => $errorArr);
            $dbObj->close();
            //Close Database Connection
            header('Content-type: application/json');
            echo json_encode($json);
        }
    }
}
开发者ID:Mojolagbe2014,项目名称:mojoimipakiti,代码行数:31,代码来源:delete-admin.php

示例3: delete

 /**
  * @before _secure
  */
 public function delete($id)
 {
     parent::delete($id);
     $view = $this->getActionView();
     $usr = \User::first(['_id' => $id, 'org_id' => $this->org->_id]);
     $allowedTypes = ['afm', 'adm'];
     if ($usr->type === 'admin') {
         $view->set('message', 'Can not remove admin!!');
     } else {
         if (in_array($usr->type, $allowedTypes)) {
             $usr->delete();
         }
         $view->set('message', 'Accout Deleted!!');
     }
 }
开发者ID:vNative,项目名称:vnative,代码行数:18,代码来源:account.php

示例4: __construct

 /**
  * Create admin page
  * 
  * @author Thibaud Rohmer
  */
 public function __construct()
 {
     /// Check that current user is an admin or an uploader
     if (!(CurrentUser::$admin || CurrentUser::$uploader)) {
         return;
     }
     /// Get actions available for Uploaders too
     if (isset($_GET['a'])) {
         switch ($_GET['a']) {
             case "Abo":
                 $this->page = new AdminAbout();
                 break;
             case "Upl":
                 if (isset($_POST['path'])) {
                     AdminUpload::upload();
                     CurrentUser::$path = File::r2a(stripslashes($_POST['path']));
                 }
                 break;
             case "Mov":
                 if (isset($_POST['pathFrom'])) {
                     try {
                         CurrentUser::$path = File::r2a(dirname(stripslashes($_POST['pathFrom'])));
                     } catch (Exception $e) {
                         CurrentUser::$path = Settings::$photos_dir;
                     }
                 }
                 Admin::move();
                 if (isset($_POST['move']) && $_POST['move'] == "rename") {
                     try {
                         if (is_dir(File::r2a(stripslashes($_POST['pathFrom'])))) {
                             CurrentUser::$path = dirname(File::r2a(stripslashes($_POST['pathFrom']))) . "/" . stripslashes($_POST['pathTo']);
                         }
                     } catch (Exception $e) {
                         CurrentUser::$path = Settings::$photos_dir;
                     }
                 }
                 break;
             case "Del":
                 if (isset($_POST['del'])) {
                     if (!is_array($_POST['del'])) {
                         CurrentUser::$path = dirname(File::r2a(stripslashes($_POST['del'])));
                     } else {
                         CurrentUser::$path = dirname(File::r2a(stripslashes($_POST['del'][0])));
                     }
                     Admin::delete();
                 }
                 break;
         }
     }
     /// Check that current user is an admin
     if (!CurrentUser::$admin) {
         return;
     }
     /// Get action
     if (isset($_GET['a'])) {
         switch ($_GET['a']) {
             case "Sta":
                 $this->page = new AdminStats();
                 break;
             case "VTk":
                 $this->page = new GuestToken();
                 break;
             case "DTk":
                 if (isset($_POST['tokenkey'])) {
                     GuestToken::delete($_POST['tokenkey']);
                 }
                 $this->page = new GuestToken();
                 break;
             case "Acc":
                 if (isset($_POST['edit'])) {
                     Account::edit($_POST['login'], $_POST['old_password'], $_POST['password'], $_POST['name'], $_POST['email'], NULL, $_POST['language']);
                 }
                 if (isset($_POST['login'])) {
                     $this->page = new Account($_POST['login']);
                 } else {
                     $this->page = CurrentUser::$account;
                 }
                 break;
             case "GC":
                 Group::create($_POST['group']);
                 $this->page = new Group();
                 break;
             case "AAc":
                 Account::create($_POST['login'], $_POST['password'], $_POST['verif']);
                 $this->page = new Group();
                 break;
             case "AGA":
                 $a = new Account($_POST['acc']);
                 $a->add_group($_POST['group']);
                 $a->save();
                 $this->page = CurrentUser::$account;
                 break;
             case "AGR":
                 $a = new Account($_POST['acc']);
                 $a->remove_group($_POST['group']);
//.........这里部分代码省略.........
开发者ID:inscriptionweb,项目名称:PhotoShow,代码行数:101,代码来源:Admin.php

示例5: delete

 /**
  * @before _secure
  */
 public function delete($id)
 {
     parent::delete($id);
     $view = $this->getActionView();
     $ad = \Ad::first(["_id = ?" => $id, "org_id = ?" => $this->org->_id]);
     if (!$ad) {
         return $view->set('message', 'Invalid Request!!');
     }
     $msg = $ad->delete();
     $view->set($msg);
 }
开发者ID:vNative,项目名称:vnative,代码行数:14,代码来源:campaign.php

示例6: Admin

<?php

include '../php_library/class_admin.php';
$id = $_GET['id'];
$post = new Admin();
$post->delete($id);
开发者ID:polodev,项目名称:oop_php_blog,代码行数:6,代码来源:delete_post.php

示例7: sqlInjection

<?php

session_start();
require "../includes/checkPermission.php";
require "../../deny/connector.php";
require "class/class.Admin.php";
require "../includes/injection.php";
$aid = sqlInjection($_POST['adminID']);
$continue = $_POST['continue'];
$adm = new Admin();
if ($_SESSION['ADMIN'] != $aid) {
    $adm->delete($aid);
}
echo "<meta http-equiv='refresh' content='0;url=../admincp.php?opt=listadmin'>";
//header("location: ../admincp.php?opt=listadmin");
//exit();
开发者ID:meghv999,项目名称:cdshop-php,代码行数:16,代码来源:deleteAdmin.php

示例8: Admin

    }
}
//OBJECT OF adminusercontroller
$admin = new Admin();
//IF m IS SET, SET IT TO $method, ELSE DEFAULT IT TO index
if (isset($_GET['m'])) {
    $method = $_GET['m'];
} else {
    $method = "index";
}
switch ($method) {
    case "index":
        $admin->index();
        break;
    case "add":
        $admin->add();
        break;
    case "edit":
        $admin->edit();
        break;
    case "delete":
        $admin->delete();
        break;
    case "check":
        $admin->check();
        break;
    case "logout":
        $admin->logout();
    default:
        $admin->index();
}
开发者ID:pratishshr,项目名称:Aawaaj,代码行数:31,代码来源:Admin.php

示例9: __construct

<?php

require_once "AccessData.php";
header("Access-Control-Allow-Orgin: *");
header("Access-Control-Allow-Methods: *");
header("Content-Type: application/json");
$admin = new Admin();
if (isset($_POST['message_id'])) {
    $admin->delete($_POST['message_id']);
} else {
    if (isset($_POST['login']) && isset($_POST['password'])) {
        $admin->authorise($_POST['login'], $_POST['password']);
    } else {
        if (isset($_POST['signout'])) {
            $admin->signout();
        } else {
            $admin->response("Unknown params", 500);
        }
    }
}
class Admin
{
    public function __construct()
    {
        session_start();
    }
    function authorise($login, $password)
    {
        if ($login == 'admin' && $password == 'admin') {
            $token = bin2hex(openssl_random_pseudo_bytes(16));
            setcookie('access_token', $token, time() + 1800);
开发者ID:shapovalovei,项目名称:Guest-book,代码行数:31,代码来源:Admin.php


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