fix ban system 100% + replace the previous fix with better one + new admin panel by ZravianX version

This commit is contained in:
unknown
2012-04-02 01:39:38 +03:00
parent d0f05e0e9a
commit 786e240c90
107 changed files with 2883 additions and 1583 deletions
+64 -2
View File
@@ -13,43 +13,70 @@
class Profile {
public function procProfile($post) {
global $session;
if(isset($post['ft'])) {
switch($post['ft']) {
case "p1":
if($session->access!=BANNED){
$this->updateProfile($post);
}else{
header("Location: banned.php");
}
break;
case "p3":
if($session->access!=BANNED){
$this->updateAccount($post);
}else{
header("Location: banned.php");
}
break;
}
}
if(isset($post['s'])) {
switch($post['s']) {
case "4":
if($session->access!=BANNED){
$this->gpack($post);
}else{
header("Location: banned.php");
}
break;
}
}
}
public function procSpecial($get) {
global $session;
if(isset($get['e'])) {
switch($get['e']) {
case 2:
if($session->access!=BANNED){
$this->removeMeSit($get);
}else{
header("Location: banned.php");
}
break;
case 3:
if($session->access!=BANNED){
$this->removeSitter($get);
}else{
header("Location: banned.php");
}
break;
case 4:
if($session->access!=BANNED){
$this->cancelDeleting($get);
}else{
header("Location: banned.php");
}
break;
}
}
}
private function updateProfile($post) {
global $database;
global $database,$session;
if($session->access!=BANNED){
$birthday = $post['jahr'].'-'.$post['monat'].'-'.$post['tag'];
$database->submitProfile($database->RemoveXSS($post['uid']),$database->RemoveXSS($post['mw']),$database->RemoveXSS($post['ort']),$database->RemoveXSS($birthday),$database->RemoveXSS($post['be2']),$database->RemoveXSS($post['be1']));
$varray = $database->getProfileVillages($post['uid']);
@@ -57,12 +84,19 @@ class Profile {
$database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$database->RemoveXSS($post['dname'.$i]));
}
header("Location: ?uid=".$post['uid']);
}else{
header("Location: banned.php");
}
}
private function gpack($post) {
global $database, $session;
if($session->access!=BANNED){
$database->gpack($database->RemoveXSS($session->uid),$database->RemoveXSS($post['custom_url']));
header("Location: ?uid=".$session->uid);
}else{
header("Location: banned.php");
}
}
private function updateAccount($post) {
global $database,$session,$form;
@@ -78,7 +112,11 @@ class Profile {
$form->addError("pw",PASS_MISMATCH);
}
if($post['email_alt'] == $session->userinfo['email']) {
if($session->access!=BANNED){
$database->updateUserField($post['uid'],"email",$post['email_neu'],1);
}else{
header("Location: banned.php");
}
}
else {
$form->addError("email",EMAIL_ERROR);
@@ -88,7 +126,11 @@ class Profile {
$form->addError("del",ALLI_OWNER);
}
else {
if($session->access!=BANNED){
$database->setDeleting($post['uid'],0);
}else{
header("Location: banned.php");
}
}
}
else {
@@ -101,19 +143,32 @@ class Profile {
}
else {
if($session->userinfo['sit1'] == 0) {
if($session->access!=BANNED){
$database->updateUserField($post['uid'],"sit1",$sitid,1);
}else{
header("Location: banned.php");
}
}
else if($session->userinfo['sit2'] == 0) {
if($session->access!=BANNED){
$database->updateUserField($post['uid'],"sit2",$sitid,1);
}else{
header("Location: banned.php");
}
}
}
}
$_SESSION['errorarray'] = $form->getErrors();
if($session->access!=BANNED){
header("Location: spieler.php?s=3");
}else{
header("Location: banned.php");
}
}
private function removeSitter($get) {
global $database,$session;
if($session->access!=BANNED){
if($get['a'] == $session->checker) {
if($session->userinfo['sit'.$get['type']] == $get['id']) {
$database->updateUserField($session->uid,"sit".$get['type'],0,1);
@@ -121,21 +176,28 @@ class Profile {
$session->changeChecker();
}
header("Location: spieler.php?s=".$get['s']);
}else{
header("Location: banned.php");
}
}
private function cancelDeleting($get) {
global $database;
global $database,$session;
$database->setDeleting($get['id'],1);
header("Location: spieler.php?s=".$get['s']);
}
private function removeMeSit($get) {
global $database,$session;
if($session->access!=BANNED){
if($get['a'] == $session->checker) {
$database->removeMeSit($get['id'],$session->uid);
$session->changeChecker();
}
header("Location: spieler.php?s=".$get['s']);
}else{
header("Location: banned.php");
}
}
};
$profile = new Profile;