Example #1
0
 } elseif ($_GET['action'] == 'delete') {
     if (!$_SESSION['user']['role'] == 'Admin') {
         die("niet genoeg rechten");
     }
     print_r($_GET['id']);
     if (is_numeric($_GET['id'])) {
         $usr = new User(array('id' => $_GET['id']));
         $id = $usr->delete();
         $msg = "Gebruiker met success weggewerkt!";
     } else {
         $msg = "id niet numeriek";
     }
 } elseif ($_GET['action'] == 'changepw') {
     if ($_POST['password1'] == $_POST['password2']) {
         $user = new User(array('id' => $_SESSION['user']['id'], 'password' => $_POST['password'], 'newpw' => $_POST['password1']));
         $res = $user->changepw();
         if ($res) {
             $msg = 'Password gewijzigd!';
         } else {
             $msg = 'Error bij password wijzigen.';
         }
     } else {
         $msg = 'error';
     }
 } elseif ($_GET['action'] == 'photo') {
     $url = $_FILES['photo']['name'];
     // Set $url To Equal The Filename For Later Use
     if ($_FILES['photo']['type'] == "image/jpg" || $_FILES['photo']['type'] == "image/jpeg" || $_FILES['photo']['type'] == "image/pjpeg") {
         $file_ext = strrchr($_FILES['photo']['name'], '.');
         // Get The File Extention In The Format Of , For Instance, .jpg, .gif or .php
         print 'Image uploaded successfully.<br />';