public function readAction() { // instantiate new userObject $user = new UserItem(); // assign the username and password $user->email = $this->_params['email']; $user->password = $this->_params['password']; // returns userId as INT return $user->getUserId(); }
public function hasbetted($id64) { $op = UserItem::where('match_id', '=', $this->id)->where('steamid64', '=', $id64)->get(); if ($op->count() > 0) { return $op; } else { return false; } }
public function __whenReady() { // Check Migrations Done if ($this->module->migrationsDone()) { // Add Permission addAdminPermission("manage_users", "Manage Users"); // Add Permission addAdminPermission("maintainance_mode", "Maintainance Mode Access"); // Add Permission addAdminPermission("manage_acl", "Manage Groups and Permissions"); // Add the Required Styles and Scripts registerAdminStyle("auth-admin", __DIR__ . "/styles/auth.css"); registerAdminScript("auth-admin", __DIR__ . "/scripts/auth.js"); setAdminStyleToUse("auth-admin"); // Listen Controller Ready Event $this->app["events"]->listen("admin.controller.ready", function () { // Check Nav if ($nav = nav(adminNavGroup())) { // Add Logout Link $nav->addMenuItem("logout", trans("auth-module::menu_item.logout"), urlRoute(UserItem::logoutRoute(), UserItem::logoutRouteParams()), null, null, 1000); // Add My Account Link $nav->addSubMenuItem(ADMIN_NAV_DASHBOARD, "my_account", trans("auth-module::menu_item.my_account"), urlRoute("my_account"), null, null, 1); // Check Permission if (userHasPermission("manage_acl")) { // Add ACL Navigation Items $nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", trans("auth-module::menu_item.acl"), urlRoute("groups")); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", "groups", trans("auth-module::menu_item.groups"), urlRoute("groups"), array("include" => array("/create_group/i", "/edit_group\\/(.*)/i"))); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "acl", "permissions", trans("auth-module::menu_item.permissions"), urlRoute("permissions"), array("include" => array("/create_permission/i", "/edit_permission\\/(.*)/i"))); } // Check Permission if (userHasPermission("manage_users")) { // Add User Navigation Items $nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", trans("auth-module::menu_item.users"), urlRoute("users")); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", "create_user", trans("auth-module::menu_item.add_new_user"), urlRoute("create_user")); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, "users", "users", trans("auth-module::menu_item.view_users"), urlRoute("users"), array("include" => array("/edit_user\\/(.*)/i"))); } // Get Groups with Interfaces $groups = GroupItem::hasInterface()->get(); // Loop Each Groups foreach ($groups as $group) { // Check Routes & Langs if ($group->hasValidInterface() && (!$group->group_permission || userHasPermission($group->group_permission))) { // Add Navigation Items $nav->detectAddSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getLang("menu_list"), urlRoute($group->getRoute("list"))); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getRoute("create"), $group->getLang("menu_add_new"), urlRoute($group->getRoute("create"))); $nav->detectAddSubSubMenuItem(ADMIN_NAV_ADMINISTRATION, $group->getRoute("list"), $group->getRoute("list"), $group->getLang("menu_view_list"), urlRoute($group->getRoute("list")), array("include" => array("/" . $group->getRoute("edit") . "\\/(.*)/i"))); } } } }); } }
<?php session_start(); date_default_timezone_set('America/Mexico_City'); include_once "models/user.php"; include_once "models/item.php"; include_once "models/user_item.php"; if (empty($_POST)) { header("HTTP/1.1 500 Internal Server Error"); } header('Content-Type: application/json'); $user = new User(); $item = new Item(); $ui = new UserItem(); $max_participations = 1; switch (@$_POST['method']) { case 'save_user': $name = $_POST['nombre']; $lastname = $_POST['apellido']; $mail = $_POST['mail']; $phone = $_POST['telefono']; evaluate($name, 'nombre'); evaluate($lastname, 'apellido'); evaluate($mail, 'correo', 'isEmail'); evaluate($phone, 'teléfono', 'isPhone'); $id = $user->exist($mail); if (!$id) { $id = $user->create($name, $lastname, $mail, $phone); } if ($ui->num_of_participations($id) >= $max_participations) { fail("Has llegado al límite de participaciones por usuario, gracias por tu interés");
public function pending() { $pending = UserItem::where('steamid64', '=', Auth::user()->steamid64)->where('steamid64_bot', '=', $this->steamid64)->where('status', '=', 1)->get(); return $pending->count(); }
<?php session_start(); date_default_timezone_set('America/Mexico_City'); include_once "models/user.php"; include_once "models/item.php"; include_once "models/user_item.php"; if (empty($_POST)) { header("HTTP/1.1 500 Internal Server Error"); } header('Content-Type: application/json'); $user = new User(); $item = new Item(); $ui = new UserItem(); $max_participations = 1; switch ($_POST['method']) { case 'save_user': $name = $_POST['nombre']; $lastname = $_POST['apellido']; $mail = $_POST['mail']; $phone = $_POST['telefono']; evaluate($name, 'nombre'); evaluate($lastname, 'apellido'); evaluate($mail, 'correo', 'isEmail'); evaluate($phone, 'teléfono', 'isPhone'); $id = $user->exist($mail); if (!$id) { $id = $user->create($name, $lastname, $mail, $phone); } if ($ui->num_of_participations($id) >= $max_participations) { fail("Has llegado al límite de participaciones por usuario, gracias por tu interés");
*/ if (isset($_POST['method'])) { switch ($_POST['method']) { case 'login': if (password_verify($_POST['usr'], '$2y$10$bnRkL8y4UuJU8uRSJ0lMpuFJpeaVzLnhQbdCfUzVUnqufWTipqo7a') && password_verify($_POST['pwd'], '$2y$10$3EpeVSvtNswi7W4ArW8QVuniRBb4IQ4GFP/8QUjyO6lFFKtBEZfim')) { $_SESSION['admin'] = base64_encode($_POST['usr'] . $_POST['pwd']); } break; } } ?> <body> <div class="admin container"> <?php if (isset($_SESSION['admin']) && $_SESSION['admin'] == base64_encode("AdminSOCV3g4\$3\$0r3s")) { $ui = new UserItem(); $contestants = $ui->get_all_contestants(); ?> <table> <thead> <tr> <th>Nombre</th> <th>Apellido</th> <th>Correo</th> <th>Teléfono</th> <th>Premio</th> </tr> </thead> <tbody> <?php foreach ($contestants as $user) {
/** * Returns the static model of the specified AR class. * @param string $className active record class name. * @return WUserItem the static model class */ public static function model($className = __CLASS__) { return parent::model($className); }