[freeside-commits] freeside/fs_selfservice/fri/includes common.php, 1.1.1.1, 1.2 login.php, 1.1.1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Sun Mar 16 14:07:08 PDT 2008
Update of /home/cvs/cvsroot/freeside/fs_selfservice/fri/includes
In directory wavetail.420.am:/tmp/cvs-serv4339/includes
Modified Files:
common.php login.php
Log Message:
first try at single sign-on
Index: login.php
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/fri/includes/login.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- login.php 16 Mar 2008 19:58:26 -0000 1.1.1.1
+++ login.php 16 Mar 2008 21:07:04 -0000 1.2
@@ -279,6 +279,37 @@
$_SESSION['ari_error'] = _("Incorrect Username or Password");
}
+ // freeside login
+ $freeside = new FreesideSelfService()
+ $domain = 'svc_phone';
+ $response = $freeside->login( array(
+ 'username' => strtolower($_username),
+ 'domain' => $domain,
+ 'password' => strtolower($password),
+ ) );
+ error_log("[login] received response from freeside: $response");
+ $error = $response['error'];
+
+ if ( ! $error ) {
+
+ // sucessful freeside login
+ error_log("[login] logged into freeside with session_id=$session_id");
+
+ // store session id in your session store, to be used for other calls
+ //$fs_session_id = $response['session_id'];
+ $_SESSION['fs_session'] = $response['session_id'];
+
+ } else {
+
+ // unsucessful login
+ error_log("[login] error logging into freeside: $error");
+ $auth = false;
+
+ // display error message to user
+ $_SESSION=['ari_error'] = _("Incorrect Username or Password");
+
+ }
+
// if authenticated and user wants to be remembered, set cookie
$remember = '';
if (isset($_POST['remember'])) {
@@ -474,4 +505,4 @@
}
-?>
\ No newline at end of file
+?>
Index: common.php
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/fri/includes/common.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- common.php 16 Mar 2008 19:58:26 -0000 1.1.1.1
+++ common.php 16 Mar 2008 21:07:04 -0000 1.2
@@ -429,5 +429,6 @@
include_once("./includes/display.php");
include_once("./includes/ajax.php");
+include_once("./includes/freeside.class.php");
?>
More information about the freeside-commits
mailing list