[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16202] more on eventplanner
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [16202] more on eventplanner |
Date: |
Fri, 27 Jan 2017 11:03:08 -0500 (EST) |
Revision: 16202
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16202
Author: sigurdne
Date: 2017-01-27 11:03:08 -0500 (Fri, 27 Jan 2017)
Log Message:
-----------
more on eventplanner
Modified Paths:
--------------
trunk/activitycalendarfrontend/inc/class.hook_helper.inc.php
trunk/bookingfrontend/inc/class.hook_helper.inc.php
trunk/eventplannerfrontend/inc/class.bouser.inc.php
trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
trunk/eventplannerfrontend/login.php
trunk/eventplannerfrontend/setup/setup.inc.php
trunk/mobilefrontend/inc/class.hook_helper.inc.php
Removed Paths:
-------------
trunk/eventplannerfrontend/inc/custom/default/Altinn_Bergen_kommune.php
Modified: trunk/activitycalendarfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/activitycalendarfrontend/inc/class.hook_helper.inc.php
2017-01-27 11:44:54 UTC (rev 16201)
+++ trunk/activitycalendarfrontend/inc/class.hook_helper.inc.php
2017-01-27 16:03:08 UTC (rev 16202)
@@ -30,23 +30,34 @@
*/
class activitycalendarfrontend_hook_helper
{
+ private $perform_action = false;
- public function set_cookie_domain()
+ public function __construct()
{
$script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
-
+
if(preg_match('/activitycalendarfrontend/',
$script_path))
{
- //get from local config
- $config = CreateObject('phpgwapi.config',
'activitycalendarfrontend');
- $config->read();
+ $this->perform_action = true;
+ }
+ }
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+ public function set_cookie_domain()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
- if
(!empty($config->config_data['cookie_domain']))
- {
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
- }
- }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'activitycalendarfrontend');
+ $config->read();
+
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+
+ if (!empty($config->config_data['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
+ }
}
}
\ No newline at end of file
Modified: trunk/bookingfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/bookingfrontend/inc/class.hook_helper.inc.php 2017-01-27 11:44:54 UTC
(rev 16201)
+++ trunk/bookingfrontend/inc/class.hook_helper.inc.php 2017-01-27 16:03:08 UTC
(rev 16202)
@@ -31,23 +31,33 @@
class bookingfrontend_hook_helper
{
+ private $perform_action = false;
- public function set_cookie_domain()
+ public function __construct()
{
$script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
-
+
if(preg_match('/bookingfrontend/', $script_path))
{
- //get from local config
- $config = CreateObject('phpgwapi.config',
'bookingfrontend');
- $config->read();
+ $this->perform_action = true;
+ }
+ }
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+ public function set_cookie_domain()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'bookingfrontend');
+ $config->read();
- if
(!empty($config->config_data['cookie_domain']))
- {
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
- }
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+
+ if (!empty($config->config_data['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
}
}
}
\ No newline at end of file
Modified: trunk/eventplannerfrontend/inc/class.bouser.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.bouser.inc.php 2017-01-27 11:44:54 UTC
(rev 16201)
+++ trunk/eventplannerfrontend/inc/class.bouser.inc.php 2017-01-27 16:03:08 UTC
(rev 16202)
@@ -32,7 +32,7 @@
protected function get_orgname_from_db( $orgnr )
{
$this->db = & $GLOBALS['phpgw']->db;
- $this->db->limit_query("select name from
bb_organization where organization_number ='" . $orgnr . "'", 0, __LINE__,
__FILE__, 1);
+ $this->db->limit_query("SELECT name FROM
bb_organization WHERE organization_number ='" . $orgnr . "'", 0, __LINE__,
__FILE__, 1);
if (!$this->db->next_record())
{
return $orgnr;
@@ -44,7 +44,7 @@
{
$results = array();
$this->db = & $GLOBALS['phpgw']->db;
- $this->db->query("select organization_number from
bb_organization ORDER by organization_number ASC", __LINE__, __FILE__);
+ $this->db->query("SELECT organization_number FROM
bb_organization ORDER by organization_number ASC", __LINE__, __FILE__);
while ($this->db->next_record())
{
$results[] =
$this->db->f('organization_number', false);
@@ -236,16 +236,22 @@
}
}
+ /**
+ * Used???
+ * @param type $fodselsnr
+ * @return type
+ */
protected function get_breg_orgs( $fodselsnr )
{
- $breg_conn = pg_connect("host=" .
$GLOBALS['phpgw_domain']['default']['db_host'] . " port=5432 dbname=breg user="
. $GLOBALS['phpgw_domain']['default']['db_user'] . " password=" .
$GLOBALS['phpgw_domain']['default']['db_pass']) or die('connection failed');
- $sql = "SELECT distinct orgnr FROM breg.personcurrent
WHERE fodselsnr ='" . $fodselsnr . "'";
- $results = pg_query($breg_conn, $sql);
- $orgs = pg_fetch_all($results);
- print_r($sql);
- print_r($orgs);
- pg_close($breg_conn);
- return $orgs;
+ $sql = "SELECT DISTINCT orgnr FROM breg.personcurrent
WHERE fodselsnr ='" . $fodselsnr . "'";
+ $results = array();
+ $db = & $GLOBALS['phpgw']->db;
+ $db->query($sql, __LINE__, __FILE__);
+ while ($db->next_record())
+ {
+ $results[] = $db->f('orgnr', true);
+ }
+ return $results;
}
protected function get_user_orgnr_from_auth_header()
Modified: trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.hook_helper.inc.php 2017-01-27
11:44:54 UTC (rev 16201)
+++ trunk/eventplannerfrontend/inc/class.hook_helper.inc.php 2017-01-27
16:03:08 UTC (rev 16202)
@@ -34,12 +34,72 @@
class eventplannerfrontend_hook_helper extends phpgwapi_uicommon
{
+ private $perform_action = false;
+
public function __construct()
{
- parent::__construct();
- $GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
+ /**
+ * Wait for it...
+ */
+ //parent::__construct();
+
+ $script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
+
+ if(preg_match('/eventplannerfrontend/', $script_path))
+ {
+ $this->perform_action = true;
+ }
}
/**
+ * set auth_type for custom login - called from login
+ *
+ * @return void
+ */
+ public function set_auth_type()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'eventplannerfrontend')->read();
+
+ if (!empty($config['auth_type']))
+ {
+ $GLOBALS['phpgw_info']['server']['auth_type'] =
$config['auth_type'];
+ }
+ }
+
+ public function set_cookie_domain()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'eventplannerfrontend')->read();
+
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+
+ if (!empty($config['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] = $config['cookie_domain'];
+ }
+
+ }
+
+ public function login( )
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ $bouser = CreateObject('eventplannerfrontend.bouser');
+ $bouser->log_in();
+ }
+
+ /**
* Show info for homepage
*
* @return void
@@ -46,11 +106,88 @@
*/
public function home()
{
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ parent::__construct();
+
$data = array(
'config' => CreateObject('phpgwapi.config',
'eventplannerfrontend')->read(),
);
- phpgwapi_jquery::formvalidator_generate(array());
- self::add_javascript('eventplannerfrontend', 'portico',
'validate.js');
self::render_template_xsl(array('home'), array('view'
=> $data));
}
+
+ public function after_navbar()
+ {
+ if(!$this->perform_action)
+ {
+ return;
+ }
+ //parent::__construct();
+
+
+ if(!empty($_SESSION['orgs']) &&
is_array($_SESSION['orgs']))
+ {
+ $orgs = $_SESSION['orgs'];
+ $org_id = !empty($_SESSION['org_id']) ?
$_SESSION['org_id'] : '';
+ }
+ else
+ {
+ return;
+ }
+
+ $org_option ='';
+ foreach ($orgs as $org)
+ {
+ $selected = '';
+ if ($org_id == $org['id'])
+ {
+ $selected = 'selected = "selected"';
+ }
+
+ $org_option .= <<<HTML
+
+ <option
value='{$org['id']}'{$selected}>{$org['name']}</option>
+
+HTML;
+ }
+
+
+// _debug_array($_SERVER);
+
+ if ($orgs)
+ {
+// $action =
$GLOBALS['phpgw']->link('/eventplannerfrontend/login.php', array('stage' => 2));
+ $action =
"{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}";
+ $message = 'Velg organisasjon';
+
+ $org_select = <<<HTML
+ <p>
+ <label
for="org_id">Velg Organisasjon:</label>
+ <select
name="org_id" id="org_id">
+
{$org_option}
+ </select>
+ </p>
+HTML;
+ }
+
+ $html = <<<HTML
+ <!DOCTYPE html>
+ <h2>{$message}</h2>
+ <form action="{$action}" method="POST">
+ <fieldset>
+ <legend>
+ Organisasjon
+ </legend>
+ $org_select
+ <p>
+ <input
type="submit" name="submit" value="Fortsett" />
+ </p>
+ </fieldset>
+ </form>
+HTML;
+
+ echo $html;
+ }
}
\ No newline at end of file
Modified:
trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
===================================================================
--- trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
2017-01-27 11:44:54 UTC (rev 16201)
+++ trunk/eventplannerfrontend/inc/custom/default/Altinn2_Bergen_kommune.php
2017-01-27 16:03:08 UTC (rev 16202)
@@ -30,22 +30,26 @@
* Wrapper for custom methods
*
* @package phpgroupware
- * @subpackage bookingfrontend
+ * @subpackage eventplannerfrontend
*/
- class bookingfrontend_external_user extends bookingfrontend_bouser
+ class eventplannerfrontend_external_user extends
eventplannerfrontend_bouser
{
+ var $debug = true;
public function __construct()
{
parent::__construct();
+ if (isset($this->config->config_data['debug']) &&
$this->config->config_data['debug'])
+ {
+ $this->debug = true;
+ }
}
public function get_user_org_id()
{
$headers = getallheaders();
- if (isset($this->config->config_data['debug']) &&
$this->config->config_data['debug'])
+ if ($this->debug)
{
- $this->debug = true;
echo 'headers:<br>';
_debug_array($headers);
}
@@ -86,7 +90,7 @@
try
{
$action = "";
- $response = $client->__doRequest($request,
$location_URL, $action, 1);
+ // $response = $client->__doRequest($request,
$location_URL, $action, 1);
$reader = new XMLReader();
$reader->xml($response);
@@ -108,6 +112,7 @@
'name' =>
$xml->getElementsByTagName('name')->item(0)->nodeValue,
);
$orgs_validate[] = $_org_id;
+
}
}
}
@@ -118,6 +123,14 @@
var_dump($exception);
}
+ if ($this->debug)
+ {
+ $orgs[] = array('id' => '123456789', 'name' =>
'Bergen kommune');
+ }
+ $_SESSION['orgs'] = $orgs;
+ $_SESSION['org_id'] = $_org_id; // one of them..
+return;
+
$stage = phpgw::get_var('stage');
$org_id = phpgw::get_var('org_id');
@@ -154,7 +167,7 @@
if ($orgs)
{
- $action =
$GLOBALS['phpgw']->link('/bookingfrontend/login.php', array('stage' => 2));
+ $action =
$GLOBALS['phpgw']->link('/eventplannerfrontend/login.php', array('stage' => 2));
$message = 'Velg organisasjon';
$org_select = <<<HTML
@@ -168,7 +181,7 @@
}
else
{
- $action =
$GLOBALS['phpgw']->link('/bookingfrontend/index.php');
+ $action =
$GLOBALS['phpgw']->link('/eventplannerfrontend/index.php');
$message = 'Ikke representant for noen
organisasjon';
$org_select = '';
}
Deleted: trunk/eventplannerfrontend/inc/custom/default/Altinn_Bergen_kommune.php
===================================================================
--- trunk/eventplannerfrontend/inc/custom/default/Altinn_Bergen_kommune.php
2017-01-27 11:44:54 UTC (rev 16201)
+++ trunk/eventplannerfrontend/inc/custom/default/Altinn_Bergen_kommune.php
2017-01-27 16:03:08 UTC (rev 16202)
@@ -1,340 +0,0 @@
-<?php
- /**
- * phpGroupWare
- *
- * @author Sigurd Nes <address@hidden>
- * @copyright Copyright (C) 2010 Free Software Foundation, Inc.
http://www.fsf.org/
- * @license http://www.gnu.org/licenses/gpl.html GNU General Public
License
- * @internal Development of this application was funded by
http://www.bergen.kommune.no/
- * @package phpgroupware
- * @subpackage communication
- * @category core
- * @version $Id: Altinn_Bergen_kommune.php 14728 2016-02-11 22:28:46Z
sigurdne $
- */
- /*
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
- /**
- * Wrapper for custom methods
- *
- * @package phpgroupware
- * @subpackage bookingfrontend
- */
- class bookingfrontend_external_user extends bookingfrontend_bouser
- {
-
- public function __construct()
- {
- parent::__construct();
- }
-
- public function get_user_org_id()
- {
-
- $header_key =
isset($this->config->config_data['header_key']) &&
$this->config->config_data['header_key'] ?
$this->config->config_data['header_key'] : 'Osso-User-Dn';
- $header_regular_expression =
isset($this->config->config_data['header_regular_expression']) &&
$this->config->config_data['header_regular_expression'] ?
$this->config->config_data['header_regular_expression'] :
'/^cn=(.*),cn=users.*$/';
-
- $headers = getallheaders();
-
- if (isset($this->config->config_data['debug']) &&
$this->config->config_data['debug'])
- {
- $this->debug = true;
- echo 'headers:<br>';
- _debug_array($headers);
- }
-
- if (isset($headers[$header_key]) &&
$headers[$header_key])
- {
- $matches = array();
- preg_match_all($header_regular_expression,
$headers[$header_key], $matches);
- $userid = $matches[1][0];
-
- if ($this->debug)
- {
- echo 'matches:<br>';
- _debug_array($matches);
- }
- }
-
- $options = array();
- $options['soap_version'] = SOAP_1_1;
- $options['location'] =
isset($this->config->config_data['soap_location']) &&
$this->config->config_data['soap_location'] ?
$this->config->config_data['soap_location'] : '';//
'http://soat1a.srv.bergenkom.no:8888/gateway/services/BrukerService-v1';
- $options['uri'] =
isset($this->config->config_data['soap_uri']) &&
$this->config->config_data['soap_uri'] ? $this->config->config_data['soap_uri']
: '';// 'http://soat1a.srv.bergenkom.no';
- $options['trace'] = 1;
-
- if
(isset($this->config->config_data['soap_proxy_host']) &&
$this->config->config_data['soap_proxy_host'])
- {
- $options['proxy_host'] =
$this->config->config_data['soap_proxy_host'];
- }
-
- if
(isset($this->config->config_data['soap_proxy_port']) &&
$this->config->config_data['soap_proxy_port'])
- {
- $options['proxy_port'] =
$this->config->config_data['soap_proxy_port'];
- }
- $options['encoding'] =
isset($this->config->config_data['soap_encoding']) &&
$this->config->config_data['soap_encoding'] ?
$this->config->config_data['soap_encoding'] : 'UTF-8';
- $options['login'] =
isset($this->config->config_data['soap_login']) &&
$this->config->config_data['soap_login'] ?
$this->config->config_data['soap_login'] : '';
- $options['password'] =
isset($this->config->config_data['soap_password']) &&
$this->config->config_data['soap_password'] ?
$this->config->config_data['soap_password'] : '';
-
- $wsdl = isset($this->config->config_data['soap_wsdl'])
&& $this->config->config_data['soap_wsdl'] ?
$this->config->config_data['soap_wsdl'] : '';//
'http://soat1a.srv.bergenkom.no:8888/gateway/services/BrukerService-v1?wsdl';
-
- try
- {
- $BrukerService = new BrukerService($wsdl,
$options);
- }
- catch (Exception $e)
- {
- if ($this->debug)
- {
- echo $e->getMessage();
- echo '<br>wsdl: ' . $wsdl;
- echo '<br>options:';
- _debug_array($options);
- }
- }
-
- $ctx = new UserContext();
-
- $ctx->appid = 'portico';
- $ctx->onBehalfOfId = $userid;
- $ctx->userid = $userid;
- $ctx->transactionid =
$GLOBALS['phpgw_info']['server']['install_id']; // KAN UTELATES. BENYTTES I.F.M
SUPPORT. LEGG INN EN FOR DEG UNIK ID.
-
- $request = new retrieveBruker();
- $request->userContext = $ctx;
- $request->userid = $userid;
-
- $response = $BrukerService->retrieveBruker($request);
- $Bruker = $response->return;
-
- try
- {
- return
createObject('booking.sfValidatorNorwegianOrganizationNumber')->clean($Bruker->ou);
- }
- catch (sfValidatorError $e)
- {
- if ($this->debug)
- {
- echo $e->getMessage();
- die();
- }
- return null;
- }
- }
- }
- /**
- * soap client for altinn supported external login service at Bergen
Kommune
- * this code is generated by the
http://code.google.com/p/wsdl2php-interpreter/
- *
- * @package phpgroupware
- * @subpackage bookingfrontend
- */
-
- /**
- * Bruker
- */
- class Bruker
- {
-
- /**
- * @access public
- * @var string
- */
- public $uid;
-
- /**
- * @access public
- * @var string
- */
- public $mail;
-
- /**
- * @access public
- * @var string
- */
- public $preferedLocal;
-
- /**
- * @access public
- * @var string
- */
- public $givenName;
-
- /**
- * @access public
- * @var string
- */
- public $sn;
-
- /**
- * @access public
- * @var string
- */
- public $cn;
-
- /**
- * @access public
- * @var string
- */
- public $ou;
-
- }
-
- /**
- * UserContext
- */
- class UserContext
- {
-
- /**
- * @access public
- * @var string
- */
- public $userid;
-
- /**
- * @access public
- * @var string
- */
- public $onBehalfOfId;
-
- /**
- * @access public
- * @var string
- */
- public $appid;
-
- /**
- * @access public
- * @var string
- */
- public $transactionid;
-
- }
-
- /**
- * retrieveBruker
- */
- class retrieveBruker
- {
-
- /**
- * @access public
- * @var UserContext
- */
- public $userContext;
-
- /**
- * @access public
- * @var string
- */
- public $userid;
-
- }
-
- /**
- * retrieveBrukerResponse
- */
- class retrieveBrukerResponse
- {
-
- /**
- * @access public
- * @var Bruker
- */
- public $return;
-
- }
-
- /**
- * BrukerService
- * @author WSDLInterpreter
- */
- class BrukerService extends SoapClient
- {
-
- /**
- * Default class map for wsdl=>php
- * @access private
- * @var array
- */
- private static $classmap = array
- (
- "Bruker" => "Bruker",
- "UserContext" => "UserContext",
- "retrieveBruker" => "retrieveBruker",
- "retrieveBrukerResponse" => "retrieveBrukerResponse",
- );
-
- /**
- * Constructor using wsdl location and options array
- * @param string $wsdl WSDL location for this service
- * @param array $options Options for the SoapClient
- */
- public function __construct( $wsdl = '', $options = array() )
- {
- foreach (self::$classmap as $wsdlClassName =>
$phpClassName)
- {
- if
(!isset($options['classmap'][$wsdlClassName]))
- {
- $options['classmap'][$wsdlClassName] =
$phpClassName;
- }
- }
- parent::__construct($wsdl, $options);
- }
-
- /**
- * Checks if an argument list matches against a valid argument
type list
- * @param array $arguments The argument list to check
- * @param array $validParameters A list of valid argument types
- * @return boolean true if arguments match against
validParameters
- * @throws Exception invalid function signature message
- */
- public function _checkArguments( $arguments, $validParameters )
- {
- $variables = "";
- foreach ($arguments as $arg)
- {
- $type = gettype($arg);
- if ($type == "object")
- {
- $type = get_class($arg);
- }
- $variables .= "(" . $type . ")";
- }
- if (!in_array($variables, $validParameters))
- {
- throw new Exception("Invalid parameter types: "
. str_replace(")(", ", ", $variables));
- }
- return true;
- }
-
- /**
- * Service Call: retrieveBruker
- * Parameter options:
- * (retrieveBruker) parameters
- * @param mixed,... See function description for parameter
options
- * @return retrieveBrukerResponse
- * @throws Exception invalid function signature message
- */
- public function retrieveBruker( $mixed = null )
- {
- $validParameters = array(
- "(retrieveBruker)",
- );
- $args = func_get_args();
- $this->_checkArguments($args, $validParameters);
- return $this->__soapCall("retrieveBruker", $args);
- }
- }
\ No newline at end of file
Modified: trunk/eventplannerfrontend/login.php
===================================================================
--- trunk/eventplannerfrontend/login.php 2017-01-27 11:44:54 UTC (rev
16201)
+++ trunk/eventplannerfrontend/login.php 2017-01-27 16:03:08 UTC (rev
16202)
@@ -1,47 +1,7 @@
<?php
-
$GLOBALS['phpgw_info']['flags']['session_name'] =
'eventplannerfrontendsession';
require_once '../phpgwapi/inc/class.login.inc.php';
$phpgwlogin = new phpgwapi_login;
$phpgwlogin->login('eventplannerfrontend');
-
-/*
- $GLOBALS['phpgw_info']['flags'] = array
- (
- 'disable_template_class' => true,
- 'login' => true,
- 'currentapp' => 'login',
- 'noheader' => true
- );
-
- $GLOBALS['phpgw_info']['flags']['session_name'] =
'eventplannerfrontendsession';
-
- if (file_exists('../header.inc.php'))
- {
- include_once('../header.inc.php');
- $GLOBALS['phpgw']->sessions = createObject('phpgwapi.sessions');
- }
-
- $c = createobject('phpgwapi.config', 'eventplannerfrontend');
- $c->read();
- $config = $c->config_data;
- $login = $c->config_data['anonymous_user'];
- $passwd = $c->config_data['anonymous_passwd'];
- $_POST['submitit'] = "";
- $GLOBALS['sessionid'] = $GLOBALS['phpgw']->session->create($login,
$passwd);
-
- $GLOBALS['phpgw']->hooks->process('login');
-
- $bouser = CreateObject('eventplannerfrontend.bouser');
- $bouser->log_in();
-
- $after = str_replace('&', '&', urldecode(phpgw::get_var('after',
'string')));
- if (!$after)
- {
- $after = array('menuaction' =>
'eventplannerfrontend.uievents.index');
- }
- $GLOBALS['phpgw']->redirect_link('/eventplannerfrontend/index.php',
$after);
- exit;
-*/
\ No newline at end of file
Modified: trunk/eventplannerfrontend/setup/setup.inc.php
===================================================================
--- trunk/eventplannerfrontend/setup/setup.inc.php 2017-01-27 11:44:54 UTC
(rev 16201)
+++ trunk/eventplannerfrontend/setup/setup.inc.php 2017-01-27 16:03:08 UTC
(rev 16202)
@@ -37,10 +37,12 @@
/* The hooks this app includes, needed for hooks registration */
- $setup_info['eventplannerfrontend']['hooks'] = array
- (
- 'menu' => 'eventplannerfrontend.menu.get_menu',
+ $setup_info['eventplannerfrontend']['hooks'] = array(
+ 'menu' =>
'eventplannerfrontend.menu.get_menu',
'set_cookie_domain' =>
'eventplannerfrontend.hook_helper.set_cookie_domain',
+ 'set_auth_type' =>
'eventplannerfrontend.hook_helper.set_auth_type',
+ 'home' =>
'eventplannerfrontend.hook_helper.home',
+ 'login' =>
'eventplannerfrontend.hook_helper.login',
+ 'after_navbar' =>
'eventplannerfrontend.hook_helper.after_navbar',
'config',
- 'home' =>
'eventplannerfrontend.hook_helper.home',
);
Modified: trunk/mobilefrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/mobilefrontend/inc/class.hook_helper.inc.php 2017-01-27 11:44:54 UTC
(rev 16201)
+++ trunk/mobilefrontend/inc/class.hook_helper.inc.php 2017-01-27 16:03:08 UTC
(rev 16202)
@@ -30,7 +30,18 @@
*/
class mobilefrontend_hook_helper
{
+ private $perform_action = false;
+ public function __construct()
+ {
+ $script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
+
+ if(preg_match('/mobilefrontend/', $script_path))
+ {
+ $this->perform_action = true;
+ }
+ }
+
/**
* set auth_type for custom login - called from login
*
@@ -38,6 +49,10 @@
*/
public function set_auth_type()
{
+ if(!$this->perform_action)
+ {
+ return;
+ }
//get from local config
$config = CreateObject('phpgwapi.config',
'mobilefrontend');
@@ -51,20 +66,19 @@
public function set_cookie_domain()
{
- $script_path =
dirname(phpgw::get_var('SCRIPT_FILENAME', 'string', 'SERVER'));
-
- if(preg_match('/mobilefrontend/', $script_path))
+ if(!$this->perform_action)
{
- //get from local config
- $config = CreateObject('phpgwapi.config',
'mobilefrontend');
- $config->read();
+ return;
+ }
+ //get from local config
+ $config = CreateObject('phpgwapi.config',
'mobilefrontend');
+ $config->read();
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
+ $GLOBALS['phpgw_info']['server']['cookie_domain'] =
!empty($GLOBALS['phpgw_info']['server']['cookie_domain']) ?
$GLOBALS['phpgw_info']['server']['cookie_domain'] : '';
- if
(!empty($config->config_data['cookie_domain']))
- {
-
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
- }
- }
+ if (!empty($config->config_data['cookie_domain']))
+ {
+
$GLOBALS['phpgw_info']['server']['cookie_domain'] =
$config->config_data['cookie_domain'];
+ }
}
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16202] more on eventplanner,
sigurdne <=