Created
March 25, 2009 03:41
-
-
Save allometry/84543 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? if (!isset($html)) header("content-type:javascript/json\n"); ?> | |
<?=$javascript->Object($this->data)?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function login() { | |
Configure::write('debug', 0); | |
$this->data=json_decode($HTTP_RAW_POST_DATA, true); | |
$io=fopen("./jsondebug","w+"); | |
//fwrite($io, "DEBUG: " . print_r($this->data, true) . "\n"); | |
fwrite($io, "DEBUG: " . $HTTP_RAW_POST_DATA . "\n"); | |
fclose($io); | |
//$this->render("/utility/json", "ajax"); exit; | |
/* | |
$user=(array)null; | |
$user=$this->User->find("first",array("conditions"=>array("username"=>$this->data["User"]["username"], "password"=>$this->data["User"]["password"]))); | |
$this->data=(array)null; | |
if($user) { | |
$this->Session->write("auth",$user["User"]["name"]); | |
$this->data["User"]["authenticated"]=true; | |
} else { | |
$this->data["User"]["authenticated"]=false; | |
} | |
*/ | |
$this->render("/utility/json", "ajax"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment