function deleteUser($username) { global $db; if (!isRegistered($username)) { return false; } $a = $db->prepare('DELETE FROM users WHERE username = ?'); $a->execute(array($username)); return true; }
function list_action($id, $sort = "") { if (empty($id)) { $this->function_argument_error(); exit; } if (!empty($sort)) { $this->assign("prescriptions", Prescription::prescriptions_factory($id, $sort)); } else { $this->assign("prescriptions", Prescription::prescriptions_factory($id)); } // flag to indicate the CAMOS form is regsitered and active $this->assign("CAMOS_FORM", isRegistered("CAMOS")); $this->display($GLOBALS['template_dir'] . "prescription/" . $this->template_mod . "_list.html"); }
$idkey = $_GET['idkey']; $tel = $_GET['tel']; $imei = $_GET['imei']; controllaRegistra($usr, $idkey, $tel, $imei); break; case 2: //Invio Sms $sender = $_GET['snd']; $reciver = $_GET['rcv']; $msg = $_GET['msg']; sendPush($sender, $reciver, $msg); break; case 3: //ControlloRegistrazione $number = $_GET['tel']; isRegistered($number); break; case 4: //Notifica Messaggio Ricevuto $sender = $_GET['snd']; $reciver = $_GET['rcv']; $idkey = $_GET['idkey']; notificaRicevuta($sender, $reciver, $idkey); break; case 5: //Setta status $status = $_GET['status']; $idkey = $_GET['idkey']; setStatus($status, $idkey); break; case 6:
<?php include_once 'database/users.php'; session_start(); $referer; if (isset($_COOKIE['redirect'])) { $referer = $_COOKIE['redirect']; } else { $referer = './index.php'; } if (isset($_POST['login_btn'])) { if (checkCredentials($_POST['username'], $_POST['password'])) { $_SESSION['username'] = $_POST['username']; echo "<script>alert('Login successful')</script>"; } else { if (isRegistered($_POST['username'])) { echo "<script>alert('Wrong password!')</script>"; } else { echo "<script>alert('User is not registered!')</script>"; } } header('Location: ' . $referer); } else { if (isset($_POST['cancel_btn'])) { header('Location: ' . $referer); } else { echo "<h1>You shouldn't be here</h1>"; } }
<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>This event will be permanently deleted and cannot be recovered. Are you sure?</p> </div> <ul> <li><a href="#comments">comments</a></li> <?php if (isset($_SESSION['userId']) && $_SESSION['userId'] == $event['ownerId']) { ?> <li><a href="edit_event.php?id=<?php echo $event['eventId']; ?> #content">edit</a></li> <li><a href="" class="delete">delete</a></li> <?php } $_SESSION['eventId'] = $event['eventId']; if (isRegistered($event['eventId'], $_SESSION['userId'])) { ?> <li><a href="../actions/action_deregister_event.php">deregister</a></li> <?php } else { ?> <li><a href="../actions/action_register_event.php">register</a></li> <?php } ?> </ul> </div> </form> </div>