Esempio n. 1
0
               default:
                   Error('InvalID permission.');
           }
           $manage->alter_database('UPDATE Users SET Permission=\'' . $permission . '\' WHERE Username='******'username'] . '');
           break;
       case 'change_username':
           if (strlen($_POST['username']) < 4) {
               Error('Username must be more than 3 characters.');
           }
           $manage->chUsername(@$_POST['username']);
           break;
       case 'change_password':
           if (strlen($_POST['password']) < 8) {
               Error('Password must be more than 7 characters.');
           }
           $manage->chPassword($_POST['username']);
           break;
       case 'change_mail':
           if (!filter_var(@$_POST['mail'], FILTER_VALIDATE_EMAIL)) {
               Error("E-Mail is not valid.");
           }
           $manage->alter_database('UPDATE Users Mail=\'' . @$_POST['username'] . '\' WHERE Username=\'' . $manage->user->username() . '\'');
           break;
       case 'logout':
           $manage->logout();
           break;
       default:
           Error('Action doesn\'t exist.');
   }
   ?>
 <h1> Action </h1>