From bee41dc21802fdbd17b9df51c09612dbc12e6218 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sun, 31 May 2009 14:36:11 +0000 Subject: [PATCH] autologin (for Java API), rename project git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@514 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/.project | 2 +- src/messenger/webim/libs/operator.php | 12 ++++++---- src/messenger/webim/operator/autologin.php | 28 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 src/messenger/webim/operator/autologin.php diff --git a/src/messenger/.project b/src/messenger/.project index 83da58a6..1885041d 100644 --- a/src/messenger/.project +++ b/src/messenger/.project @@ -1,6 +1,6 @@ - messenger-lite-sf + messenger diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index 8aa14328..de73989f 100644 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -147,7 +147,7 @@ function generate_button($title,$locale,$style,$group,$inner,$showhost,$forcesec return "".$temp.""; } -function check_login() { +function check_login($redirect=true) { global $webimroot; if( !isset( $_SESSION['operator'] ) ) { if( isset($_COOKIE['webim_lite']) ) { @@ -162,9 +162,13 @@ function check_login() { if($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['QUERY_STRING']) { $requested .= "?".$_SERVER['QUERY_STRING']; } - $_SESSION['backpath'] = $requested; - header("Location: $webimroot/operator/login.php"); - exit; + if($redirect) { + $_SESSION['backpath'] = $requested; + header("Location: $webimroot/operator/login.php"); + exit; + } else { + return null; + } } return $_SESSION['operator']; } diff --git a/src/messenger/webim/operator/autologin.php b/src/messenger/webim/operator/autologin.php new file mode 100644 index 00000000..593ea6c9 --- /dev/null +++ b/src/messenger/webim/operator/autologin.php @@ -0,0 +1,28 @@ +OK"; +} else { + echo "FAILED"; +} + +exit; +?> \ No newline at end of file