public function initialize() { if ($err = parent::initialize()) { return $err; } // いくつかのapiはAPI Key認証なのでログイン不要 if ($this->module === 'api') { if (in_array($this->action, array('upload', 'package_list', 'delete', 'create_token'))) { return null; } } // package/install_plist はセッションが使えないため別途認証する. if ($this->module === 'package' && $this->action === 'install_plist') { return null; } $this->login_user = User::getLoginUser(); if (!$this->login_user && $this->getModule() != 'login') { $scheme = Config::get('enable_https') ? 'https' : null; $this->saveUrlBeforeLogin($scheme); return $this->redirect(mfwRequest::makeUrl('/login', $scheme)); } if ($this->login_user) { apache_log('user', $this->login_user->getMail()); } return null; }
* encargar� de incluir a la L�gica de Negocio propiamente dicha. si el archivo * no existiera, cargamos directamente el Negocio. Tambi�n es un * buen lugar para incluir Headers y Footers comunes. */ // Validar si el logueo fue exitoso if (!isset($_SESSION["pk_id_role"])) { $_SESSION["pk_id_role"] = ROLE_PUBLIC; } $security_in = 0; // No entro al logueo if (isset($_POST["user"])) { if (isset($_POST["user"]) && isset($_POST["password"])) { $security_in = 1; // Si entro al logueo $user = new User($registry[$dbSystem]); $userDataArray = $user->getLoginUser($_POST["user"], $_POST["password"]); //PRINT_R($userDataArray); $userData = array(); if (count($userDataArray) >= 1) { $userData = $userDataArray[0]; } $rolesMulti = array(); if (count($userDataArray) > 1) { foreach ($userDataArray as $item) { $rolesMulti[$item['pk_id_role']] = $item['role']; } if (isset($_POST['pk_id_role'])) { foreach ($userDataArray as $item) { if ($item['pk_id_role'] == $_POST['pk_id_role']) { $userData = $item; unset($_SESSION['ROLE_NOT_SELECTED']);
<tr> <td class="col1"> <?php Forms::printLabel($property["pages"]["security/new_user"]["ROL_LBL"]); ?> </td> <td class="col2"> <?php $rol = new Rol($db); $user = new User($registry[$dbSystem]); $userDataArray = $user->getLoginUser($_SESSION["authenticated_user"], $_SESSION["password"]); $itemsSelect = array(); foreach ($userDataArray as $rolItem) { $itemsSelect[$rolItem['pk_id_role']] = $rolItem['role']; } $rol = $_SESSION["pk_id_role"]; Forms::printInput('SELECT', 'pk_id_role', $rol, '', array('REQUIRED' => $property["FORMS"]["VALIDATION_GENERIC"]["REQUIRED_VALUE"]), $itemsSelect); ?> </td> </table>