summaryrefslogtreecommitdiff
path: root/www-ssl/nonpublic/auth.php
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2011-06-01 14:48:31 +0200
committerPhilip Häusler <msquare@notrademark.de>2011-06-01 14:48:31 +0200
commita537f4bf73101c467af3b01db32fcdb9fd0a91ce (patch)
tree0bf673d0e206866b470cf137d00a158f5fa76441 /www-ssl/nonpublic/auth.php
parent6ebee2c46ba11ce42e85b830189346b13514d497 (diff)
bootstrapping
Diffstat (limited to 'www-ssl/nonpublic/auth.php')
-rw-r--r--www-ssl/nonpublic/auth.php59
1 files changed, 35 insertions, 24 deletions
diff --git a/www-ssl/nonpublic/auth.php b/www-ssl/nonpublic/auth.php
index 2bd6f86f..7d58988c 100644
--- a/www-ssl/nonpublic/auth.php
+++ b/www-ssl/nonpublic/auth.php
@@ -1,32 +1,43 @@
<?php
- header("Content-Type: application/json");
+require_once ('../bootstrap.php');
- include "../../../camp2011/includes/config.php";
- include "../../../camp2011/includes/config_db.php";
+header("Content-Type: application/json");
- $User = $_POST['user'];
- $Pass = $_POST['pw'];
- $SourceOuth = $_POST['so'];
+include "includes/config.php";
+include "includes/config_db.php";
- if(isset($CurrentExternAuthPass) && $SourceOuth == $CurrentExternAuthPass) {
- $sql = "SELECT * FROM `User` WHERE `Nick`='" . $User . "'";
- $Erg = mysql_query($sql, $con);
+$User = $_POST['user'];
+$Pass = $_POST['pw'];
+$SourceOuth = $_POST['so'];
- if(mysql_num_rows($Erg) == 1) {
- if(mysql_result($Erg, 0, "Passwort") == $Pass) {
- $UID = mysql_result($Erg, 0, "UID");
+if (isset ($CurrentExternAuthPass) && $SourceOuth == $CurrentExternAuthPass) {
+ $sql = "SELECT * FROM `User` WHERE `Nick`='" . $User . "'";
+ $Erg = mysql_query($sql, $con);
- // get CVS import Data
- $SQL = "SELECT * FROM `UserCVS` WHERE `UID`='" . $UID . "'";
- $Erg_CVS = mysql_query($SQL, $con);
- $CVS = mysql_fetch_array($Erg_CVS);
+ if (mysql_num_rows($Erg) == 1) {
+ if (mysql_result($Erg, 0, "Passwort") == $Pass) {
+ $UID = mysql_result($Erg, 0, "UID");
- $msg = array('status' => 'success', 'rights' => $CVS);
- echo json_encode($msg);
- } else
- echo json_encode(array('status' => 'failed'));
- } else
- echo json_encode(array('status' => 'failed'));
- } else
- echo json_encode(array('status' => 'failed'));
+ // get CVS import Data
+ $SQL = "SELECT * FROM `UserCVS` WHERE `UID`='" . $UID . "'";
+ $Erg_CVS = mysql_query($SQL, $con);
+ $CVS = mysql_fetch_array($Erg_CVS);
+
+ $msg = array (
+ 'status' => 'success',
+ 'rights' => $CVS
+ );
+ echo json_encode($msg);
+ } else
+ echo json_encode(array (
+ 'status' => 'failed'
+ ));
+ } else
+ echo json_encode(array (
+ 'status' => 'failed'
+ ));
+} else
+ echo json_encode(array (
+ 'status' => 'failed'
+ ));
?>