better redirect variable
authorToby Elliott <telliott@mozilla.com>
Fri, 24 Apr 2009 11:26:58 -0700
changeset 869 408073f9efffc38a8fa3e761fe1e842a26439c19
parent 868 4b73ae97da0f87bf56ed60df071ff05bed0dcf1c
child 870 9b7839eef034fea7a831e1f23aae92ae60c6cdbe
push id525
push usertelliott@mozilla.com
push dateFri, 24 Apr 2009 18:27:01 +0000
better redirect variable
server/delete_persona.php
server/lib/user.php
--- a/server/delete_persona.php
+++ b/server/delete_persona.php
@@ -50,17 +50,16 @@
 	$user = new PersonaUser();
 
 	$auth_user = $user->authenticate();
 	$user->force_signin();
 
 	$db = new PersonaStorage();
 	$persona = $db->get_persona_by_id($id);
 	
-error_log($persona['status']);
 	if(!$persona || $persona['status'] != 1)
 	{
 		echo "We were unable to locate this persona";
 		exit;
 	}
 	
 	if (!($user->has_admin_privs() || $persona['author'] == $auth_user))
 	{
--- a/server/lib/user.php
+++ b/server/lib/user.php
@@ -199,17 +199,17 @@ class PersonaUser
 		
 		return $this->_username;
 	}
 	
 	function force_signin($admin = null)
 	{
 		if (!$this->_username)
 		{
-			header('Location: /signin?return=' . $_SERVER['SCRIPT_NAME'] . ($admin ? "&admin=1" : ""));
+			header('Location: /signin?return=' . $_SERVER['SCRIPT_URL'] . ($admin ? "&admin=1" : ""));
 			exit;
 		}
 	}		
 	
 	function log_out()
 	{
 		setcookie('PERSONA_USER', '', time() - 3600, '/');		
 		$this->_errors['success_message'] = "You have been logged out. <a href=\"http://www.getpersonas.com/\">Return to the Personas Homepage</a>";