<?php //print_r($_SESSION); if (!empty($_POST) && isset($_SESSION["user_id"])) { $alphabeth = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ1234567890_-"; $code = ""; for ($i = 0; $i < 12; $i++) { $code .= $alphabeth[rand(0, strlen($alphabeth) - 1)]; } $f = new FileData(); $f->code = $code; $f->is_public = isset($_POST["is_public"]) ? 1 : 0; $f->user_id = $_SESSION["user_id"]; $f->description = $_POST["description"]; $f->filename = $_POST["filename"]; $f->add_folder(); Core::alert("Agregado exitosamente!"); Core::redir("./?view=home"); }
if (!$is_logged) { Core::alert("Acceso Denegado!"); Core::redir("./"); } else { if ($go == false && !$is_owner) { $ps = PermisionData::getAllbyFileId($file->id); $found = false; foreach ($ps as $p) { if ($p->user_id == $_SESSION["user_id"]) { $found = true; } } if ($found == true) { $go = true; } else { Core::alert("Acceso Denegado!"); Core::redir("./?view=shared"); } } } ?> <?php if ($go || $is_owner) { ?> <div class="container"> <div class="row"> <div class="col-md-12"> <?php
<?php if (!empty($_POST)) { // print_r($_POST); $buy = BuyData::getById($_POST["buy_id"]); $buy->cancel(); Core::alert("Compra Cancelada!"); Core::redir("index.php?view=client"); }
<?php if (count($_POST) > 0) { $user = ClientData::getById($_POST["id"]); $user->name = $_POST["name"]; $user->lastname = $_POST["lastname"]; $user->address = $_POST["address"]; $user->email = $_POST["email"]; $user->phone = $_POST["phone"]; $user->update(); Core::alert("Actualizado exitosamente!"); print "<script>window.location='index.php?view=clients';</script>"; }
<?php /** * BookMedik * @author evilnapsis **/ $rx = ReservationData::getRepeated($_POST["pacient_id"], $_POST["medic_id"], $_POST["date_at"], $_POST["time_at"]); if ($rx == null) { $r = new ReservationData(); $r->title = $_POST["title"]; $r->note = $_POST["note"]; $r->pacient_id = $_POST["pacient_id"]; $r->medic_id = $_POST["medic_id"]; $r->date_at = $_POST["date_at"]; $r->time_at = $_POST["time_at"]; $r->user_id = $_SESSION["user_id"]; $r->status_id = $_POST["status_id"]; $r->payment_id = $_POST["payment_id"]; $r->price = $_POST["price"]; $r->sick = $_POST["sick"]; $r->symtoms = $_POST["symtoms"]; $r->medicaments = $_POST["medicaments"]; $r->add(); Core::alert("Agregado exitosamente!"); } else { Core::alert("Error al agregar, Cita Repetida!"); } Core::redir("./index.php?view=reservations");
<?php /** * @author evilnapsis * @brief Algoritmo para cambiar la contrase~a **/ if (isset($_SESSION["user_id"]) && !empty($_POST)) { $user = UserData::getById($_SESSION["user_id"]); if ($user->password == sha1(md5($_POST["password"]))) { if ($_POST["new_password"] == $_POST["confirm_password"]) { $user->password = sha1(md5($_POST["new_password"])); $user->update_passwd(); $_SESSION["password_updated"] = true; Core::alert("La contrase~a ha sido actualizada exitosamente!"); Core::redir("./?view=configuration"); } else { Core::alert("Las contrase~as no coinciden."); Core::redir("./?view=configuration"); } } else { Core::alert("La contrase~a introducida es incorrecta."); Core::redir("./?view=configuration"); } }
<?php if (!empty($_POST)) { $user = new UserData(); $user->name = $_POST["name"]; $user->lastname = $_POST["lastname"]; $user->username = $_POST["username"]; $user->password = sha1(md5($_POST["password"])); $user->add(); Core::alert("Registro Exitoso!, ya puedes a iniciar sesion con tu nombre de usuario y password."); Core::redir("./"); }
</tr> <tr> <td class="style5" style="width: 204px; height: 10;" valign="top"><strong> Direccion:</strong></td> <td class="style5" style="width: 4px; height: 10;" valign="top"> </td> <td class="style3" style="width: 550;" valign="top">' . $address . '</td> </tr> <tr> <td class="style5" style="height: 1;" valign="top" colspan="3"> <hr class="style28" style="height: 1; width: 98%" /></td> </tr> <tr> <td class="style5" style="width: 204px; height: 10;" valign="top"><strong> Telefono:</strong></td> <td class="style5" style="width: 4px; height: 10;" valign="top"> </td> <td class="style3" style="width: 550;" valign="top">' . $phone . '</td> </tr> </table> </body> </html> '; mail("{$replyemail}", "Katana - Nuevo registro", "{$themessage}", "From: {$replyemail}\nReply-To: {$replyemail}\nContent-Type: text/html; charset=ISO-8859-1"); mail("{$email}", "Katana - Nuevo Registro", "{$replymessage}", "From: {$replyemail}\nReply-To: {$replyemail}\nContent-Type: text/html; charset=ISO-8859-1"); echo $success_sent_msg; Core::redir("index.php?view=clientaccess"); } else { Core::alert("Ya existe un usuario registrado con esta direccion email."); Core::redir("./?view=register"); } }
<?php // registro del usuario // @author evilnapsis // @website http://evilnapsis.com/ if (!empty($_POST) && !isset($_SESSION["user_id"])) { // print_r($_POST); $user = new UserData(); $user->name = $_POST["name"]; $user->lastname = $_POST["lastname"]; $user->username = $_POST["username"]; $user->password = sha1(md5($_POST["password"])); $user->email = $_POST["email"]; $user->add(); Core::alert("Usuario regisrado exitosamente!"); Core::redir("./"); }
<?php /** * @author evilnapsis * @brief Proceso de login **/ if (!empty($_POST)) { if ($_POST["email"] != "" && $_POST["password"] != "") { $user = UserData::getLogin($_POST["email"], sha1(md5($_POST["password"]))); if ($user != null) { if ($user->is_active) { Session::set("user_id", $user->id); Core::redir("./?view=home"); } else { Session::set("user_id", $user->id); Core::alert("Debes verificar tu correo electronico, tu uso de SMILE estara limitado."); Core::redir("./?view=home"); } } else { Core::alert("Datos incorrectos"); Core::redir("./"); } } else { Core::alert("Datos vacios"); Core::redir("./"); } }
$code .= $str[rand(0, strlen($str) - 1)]; } $user = new UserData(); $user->name = $_POST["name"]; $user->lastname = $_POST["lastname"]; $user->email = $_POST["email"]; $user->password = sha1(md5($_POST["password"])); $user->code = $code; $u = $user->add(); $p = new ProfileData(); $p->user_id = $u[1]; $p->add(); $msg = "<body><h1>Registro Exitoso</h1>\r\n\t\t\t\t\t<p>Ahora debes activar tu cuenta en el siguiente link:</p>\r\n\t\t\t\t\t<p><a href='http://youhost/app/index.php?r=index/processactivation&e=" . sha1(md5($_POST["email"])) . "&c=" . sha1(md5($code)) . "'>Activa tu cuenta:</a></p>\r\n\t\t\t\t\t<p>O tambien puedes usar el siguiente codigo de activacion: " . $code . "</p>\r\n\t\t\t\t\t</body>"; mail($_POST["email"], "Registro Exitoso", $msg); /* $f = fopen (ROOT."/register.txt","w"); fwrite($f, $msg); fclose($f); */ Core::alert("Registro Exitoso!, se ha enviado un correo electronico con los datos necesarios para activar su cuenta."); Core::redir("./"); } else { Core::alert("El email proporcionado ya esta registrado."); Core::redir("./"); } } else { Core::alert("No puede dejar campos vacios"); Core::redir("./"); } } // Core::redir("./"); //View::render($this,"index",array("meta"=>$meta));
<?php if (isset($_GET["tkn"]) && $_GET["tkn"] == $_SESSION["tkn"]) { $file = FileData::getByCode($_GET["id"]); $url = "storage/data/" . $_SESSION["user_id"] . "/"; $filename = $file->filename; if (!$file->is_folder) { unlink($url . $filename); } $file->del(); Core::alert("Eliminado exitosamente!"); } else { Core::alert("Permiso Denegado!"); } Core::redir("./?view=home");
<?php if (isset($_SESSION["admin_id"])) { $admin = UserData::getById($_SESSION["admin_id"]); $user = UserData::getById($_GET["id"]); if ($user->id != $admin->id) { $client->del(); } else { Core::alert("No te puedes eliminar a ti mismo"); } Core::redir("index.php?view=users"); }
<?php if (!empty($_GET)) { $at = AlumnTeamData::getByAT($_GET["al_id"], $_GET["t_id"]); if ($at == null) { $at = new AlumnTeamData(); $at->team_id = $_GET["t_id"]; $at->alumn_id = $_GET["al_id"]; $at->add(); Core::alert("Asignacion de grupo exitosa!"); Core::redir("./?view=openalumn&id=" . $_GET["al_id"]); } }
<?php if (!empty($_POST)) { $user = UserData::getByNick($_POST["email"]); $file = FileData::getById($_POST["file_id"]); if ($user != null) { if ($user->id != $_SESSION["user_id"]) { $p = new PermisionData(); $p->user_id = $user->id; $p->file_id = $file->id; $p->p_id = $_POST["p_id"]; $p->add(); Core::alert("Agregado exitosamente!"); } else { Core::alert("No puedes agregarte ati mismo!"); } } else { Core::alert("El usuario no existe!"); } Core::redir("./?view=filepermisions&id=" . $file->code); }