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


PHP UserController::deleteUser方法代码示例

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


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

示例1: addRoutes

 static function addRoutes($app, $authenticateForRole)
 {
     //* /user/id - members can get their own profile
     $app->map("/user/get/:userId/", $authenticateForRole('member'), function ($userId) use($app) {
         UserController::selectUser($app, $userId);
     })->via('GET', 'POST');
     /*
      * id, nameFirst, nameLast, email, phone
      */
     $app->post("/user/update/:userId/", $authenticateForRole('member'), function ($userId) use($app) {
         UserController::updateUser($app, $userId);
     });
     //* /user/ routes - admin users only
     $app->group('/user', $authenticateForRole('admin'), function () use($app) {
         /*
          * nameFirst, nameLast, email, password
          */
         $app->post("/insert/", function () use($app) {
             UserController::insertUser($app);
         });
         /*
          * id
          */
         $app->map("/delete/:userId/", function ($userId) use($app) {
             UserController::deleteUser($app, $userId);
         })->via('DELETE', 'POST');
         /*
          * userId, groupId
          */
         $app->post("/unassign-group/", function () use($app) {
             UserController::unassignGroup($app);
         });
         /*
          * userId, groupId
          */
         $app->post("/assign-group/", function () use($app) {
             UserController::assignGroup($app);
         });
     });
 }
开发者ID:rachellcarbone,项目名称:angular-seed,代码行数:40,代码来源:user.routes.php

示例2: UserController

 */
// verifies that the action post variable is set and then choses
// which function to fire based on the POST['action'] value
if (isset($_POST['action'])) {
    // instantiate classes to call functions from
    $UserController = new UserController();
    $ProjectController = new ProjectController();
    $PageController = new PageController();
    // handle which function to call
    switch ($_POST['action']) {
        // User Methods
        case "createUser":
            $UserController->createUser();
            break;
        case "deleteUser":
            $UserController->deleteUser();
            break;
        case "getUser":
            $UserController->getUser();
            break;
        case "checkLoggedIn":
            $UserController->checkLoggedIn();
            break;
        case "isAdmin":
            $UserController->isAdmin();
            break;
        case "login":
            $UserController->login();
            break;
        case "logout":
            $UserController->logout();
开发者ID:ka05,项目名称:Webinator-New,代码行数:31,代码来源:dispatch.php

示例3: elseif

    if ($feedback) {
        echo JsonResponse::message(STATUS_OK, "Successfully created user!");
        exit;
    } else {
        echo JsonResponse::error("Failed! User already exist");
        exit;
    }
} elseif ($intent == 'deleteStaff') {
    // check that userid of staff to be deleted is specified
    if (!isset($_POST['userid'])) {
        echo JsonResponse::error("Incomplete parameters for delete user intent");
        exit;
    }
    $userid = $_POST['userid'];
    $userController = new UserController();
    $feedback = $userController->deleteUser($userid);
    if (is_array($feedback) && $feedback[JsonResponse::P_STATUS] == STATUS_ERROR) {
        echo JsonResponse::error($feedback[JsonResponse::P_MESSAGE]);
        exit;
    }
    if ($feedback) {
        // log user out, if they delete themself
        $loggedInUser = CxSessionHandler::getItem(UserAuthTable::userid);
        if ($loggedInUser == $userid) {
            CxSessionHandler::destroy();
            header("Location: ../../index.php");
        }
        echo JsonResponse::message(STATUS_OK, "Successfully deleted user!");
        exit;
    } else {
        echo JsonResponse::error("Could not delete this user. Try again!");
开发者ID:ademolaoduguwa,项目名称:pms,代码行数:31,代码来源:phase_admin.php

示例4: Conecta

    include "class/UserController.php";
    include "class/UserControllerOfficial.php";
    $conecta = new Conecta();
    $daoUserRegister = new DaoUserRegister();
    $modelUserRegister = new UserRegister();
    $userService = new UserController($_POST, $conecta, $daoUserRegister, $modelUserRegister);
    if ($_GET["action"] == "insert") {
        $userService->processDataForm();
        $userService->insertUser();
        header("Location:../userRegister.php");
    }
    if ($_GET["action"] == "update") {
        print "deveria cair aqui";
    }
    if ($_GET["action"] == "delete") {
        $userService->deleteUser($_GET["id"]);
        header("Location:../cadastrar.php");
    }
    if ($_GET["action"] == "view") {
    }
} else {
    include "model/Conecta.php";
    include "model/dao/userDao/DaoUserRegister.php";
    include "model/beans/UserRegister.php";
    include "class/UserController.php";
    include "class/UserControllerOfficial.php";
    $conecta = new Conecta();
    $daoUserRegister = new DaoUserRegister();
    $modelUserRegister = new UserRegister();
    $userService = new UserController($_POST, $conecta, $daoUserRegister, $modelUserRegister);
    $dados = $userService->viewUsers();
开发者ID:saulocamposi,项目名称:cmsImperativo,代码行数:31,代码来源:UserRegisterController.php

示例5: deleteUser

 public function deleteUser()
 {
     if (isset($_GET['idUser'])) {
         $managerUser = new UserDAO();
         $infos = $managerUser->getInfoUser($_SESSION['idUser']);
         $userToDelete = $managerUser->getInfoUser($_GET['idUser']);
         if ($infos['type'] == 'Admin') {
             if ($userToDelete['type'] != 'Admin') {
                 $userController = new UserController();
                 $deleteUser = $userController->deleteUser($_GET['idUser']);
                 $_SESSION['success'] = 'L\'utilisateur a bien été supprimé';
                 $_SESSION['display_msg_success'] = true;
                 $this->user();
             } else {
                 $_SESSION['error'] = 'Vous ne pouvez pas supprimer un administrateur';
                 $_SESSION['display_msg_error'] = true;
                 $this->profile();
             }
         } else {
             $_SESSION['error'] = 'Vous n\'avez pas les droits requis pour accéder à cette page';
             $_SESSION['display_msg_error'] = true;
             $this->profile();
         }
     } else {
         $_SESSION['error'] = '[5] La page n\'existe pas';
         $_SESSION['display_msg_error'] = true;
         $this->profile();
     }
 }
开发者ID:kokno,项目名称:closeClassroom_german_toson,代码行数:29,代码来源:MainController.class.php


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