[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16638] API: login from lightbox
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16638] API: login from lightbox |
Date: |
Thu, 27 Apr 2017 09:57:06 -0400 (EDT) |
Revision: 16638
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16638
Author: sigurdne
Date: 2017-04-27 09:57:06 -0400 (Thu, 27 Apr 2017)
Log Message:
-----------
API: login from lightbox
Modified Paths:
--------------
trunk/phpgwapi/inc/class.login.inc.php
trunk/phpgwapi/js/jquery/common.js
Modified: trunk/phpgwapi/inc/class.login.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.login.inc.php 2017-04-27 08:41:15 UTC (rev
16637)
+++ trunk/phpgwapi/inc/class.login.inc.php 2017-04-27 13:57:06 UTC (rev
16638)
@@ -90,6 +90,11 @@
/* Program starts here */
$uilogin = new phpgw_uilogin($tmpl,
$GLOBALS['phpgw_info']['server']['auth_type'] == 'remoteuser' &&
!isset($GLOBALS['phpgw_remote_user']));
+ if(phpgw::get_var('hide_lightbox', 'bool'))
+ {
+ $uilogin->phpgw_display_login(array());
+ }
+
if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'remoteuser' && isset($GLOBALS['phpgw_info']['server']['mapping']) &&
!empty($GLOBALS['phpgw_info']['server']['mapping']) &&
isset($_SERVER['REMOTE_USER']))
{
$login =
$GLOBALS['phpgw']->mapping->get_mapping($_SERVER['REMOTE_USER']);
@@ -123,6 +128,7 @@
// remove entities to stop mangling
$passwd =
html_entity_decode(phpgw::get_var('passwd', 'string', 'POST'));
}
+
if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'http' && isset($_SERVER['PHP_AUTH_USER']))
{
$submit = true;
@@ -225,9 +231,8 @@
unset($sslattributes);
}
- if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'customsso' && !isset($_GET['cd']))
+ if ($GLOBALS['phpgw_info']['server']['auth_type'] ==
'customsso' && (!isset($_REQUEST['skip_remote']) || !$_REQUEST['skip_remote']))
{
-
//Reset auth object
$GLOBALS['phpgw']->auth =
createObject('phpgwapi.auth');
$login =
$GLOBALS['phpgw']->auth->get_username();
@@ -246,6 +251,11 @@
}
$cd_array['skip_remote'] = true;
+ if ($lightbox)
+ {
+ $cd_array['lightbox'] = true;
+ }
+
$GLOBALS['phpgw']->redirect_link("/{$partial_url}", $cd_array);
exit;
}
@@ -266,18 +276,24 @@
$extra_vars['cd'] = 'yes';
- $GLOBALS['phpgw']->hooks->process('login');
- if ($after)
+// if ($lightbox)
+// {
+//
$GLOBALS['phpgw']->redirect_link("{$frontend}/login.php", array('hide_lightbox'
=> true));
+// }
+// else
{
- $this->redirect_after($frontend);
+
$GLOBALS['phpgw']->hooks->process('login');
+ if ($after)
+ {
+
$this->redirect_after($frontend);
+ }
+ else
+ {
+
$GLOBALS['phpgw']->redirect_link("{$frontend}/home.php", $extra_vars);
+ }
}
- else
- {
-
$GLOBALS['phpgw']->redirect_link("{$frontend}/home.php", $extra_vars);
- }
}
-
if ((isset($_POST['submitit']) ||
isset($_POST['submit_x']) || isset($_POST['submit_y'])))
{
if ($_SERVER['REQUEST_METHOD'] != 'POST' &&
@@ -350,7 +366,6 @@
}
$extra_vars['cd'] = 'yes';
- $GLOBALS['phpgw']->hooks->process('login');
if ($lightbox)
{
@@ -358,6 +373,7 @@
}
else
{
+
$GLOBALS['phpgw']->hooks->process('login');
if ($after)
{
$this->redirect_after($frontend);
Modified: trunk/phpgwapi/js/jquery/common.js
===================================================================
--- trunk/phpgwapi/js/jquery/common.js 2017-04-27 08:41:15 UTC (rev 16637)
+++ trunk/phpgwapi/js/jquery/common.js 2017-04-27 13:57:06 UTC (rev 16638)
@@ -758,9 +758,58 @@
var oArgs = {lightbox: 1};
var strURL = phpGWLink('login.php', oArgs);
var width = $(window).width() * 0.80;
- TINY.box.show({iframe: strURL, boxid: 'frameless', width: width,
height: 400, fixed: false, maskid: 'darkmask', maskopacity: 40, mask: true,
animate: false, close: false, closejs: false});
+ TINY.box.show({
+ iframe: strURL,
+ boxid: 'frameless',
+ width: width,
+ height: 400,
+ fixed: false,
+ maskid: 'darkmask',
+ maskopacity: 40,
+ mask: true,
+ animate: false,
+ close: false,
+ openjs : function ()
+ {
+ lightboxlogin_check_session();
+ },
+ closejs: false
+ });
};
+/**
+ * In case of SSO
+ *
+ */
+lightboxlogin_check_session = function()
+{
+ var oArgs = {menuaction: 'property.bocommon.confirm_session'};
+ var strURL = phpGWLink('index.php', oArgs, true);
+ $.ajax({
+ type: 'POST',
+ dataType: 'json',
+ url: strURL,
+ success: function (data)
+ {
+ if (data != null)
+ {
+ if (data['sessionExpired'] == true)
+ {
+ //ntothing
+ }
+ else
+ {
+ TINY.box.hide();
+ }
+ }
+ },
+ failure: function (o)
+ {
+ },
+ timeout: 1000
+ });
+};
+
JqueryPortico.showlightbox_history = function (sUrl)
{
TINY.box.show({iframe: sUrl, boxid: 'frameless', width: 650, height:
400, fixed: false, maskid: 'darkmask', maskopacity: 40, mask: true, animate:
true, close: true});
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16638] API: login from lightbox,
sigurdne <=