openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7ad48a722946b8fcb2f2f87f08fca5c5e9bece20
parent c80c0d5329f32c410071f996ec4c827e87f70097
Author: Jan Dankert <devnull@localhost>
Date:   Wed,  5 Sep 2018 22:38:52 +0200

Vorauswahl Datenbank-Id vereinfacht.

Diffstat:
modules/cms-core/action/LoginAction.class.php | 15++++++++-------
modules/cms-ui/themes/default/html/views/login/login.php | 4++--
modules/cms-ui/themes/default/html/views/login/login.tpl.src.xml | 4++--
3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/modules/cms-core/action/LoginAction.class.php b/modules/cms-core/action/LoginAction.class.php @@ -379,23 +379,24 @@ class LoginAction extends Action $this->setTemplateVar( 'dbids',$dbids ); + // Vorausgewählte Datenbank-Id ermiteln $db = Session::getDatabase(); if ( is_object($db) ) - $this->setTemplateVar('actdbid',$db->id); - elseif( isset($this->templateVars['actid']) ) - ; + // Datenbankverbindung ist noch in Sitzung, diese verwenden. + $this->setTemplateVar('dbid',$db->id); elseif ( isset($_COOKIE['or_dbid']) && isset($dbids[$_COOKIE['or_dbid']]) ) // DB-Id aus dem Cookie lesen. - $this->setTemplateVar('actdbid',$_COOKIE['or_dbid'] ); + $this->setTemplateVar('dbid',$_COOKIE['or_dbid'] ); elseif ( ! empty($conf['database-default']['default-id']) && isset($dbids[$conf['database-default']['default-id']])) // Default-Datenbankverbindung ist konfiguriert und vorhanden. - $this->setTemplateVar('actdbid',$conf['database-default']['default-id']); + $this->setTemplateVar('dbid',$conf['database-default']['default-id']); elseif ( count($dbids) > 0) // Datenbankverbindungen sind vorhanden, wir nehmen die erste. - $this->setTemplateVar('actdbid',array_keys($dbids)[0]); + $this->setTemplateVar('dbid',array_keys($dbids)[0]); else // Keine Datenbankverbindung vorhanden. Fallback: - $this->setTemplateVar('actdbid',''); + $this->setTemplateVar('dbid',''); + // Den Benutzernamen aus dem Client-Zertifikat lesen und in die Loginmaske eintragen. $ssl_user_var = $conf['security']['ssl']['client_cert_dn_env']; diff --git a/modules/cms-ui/themes/default/html/views/login/login.php b/modules/cms-ui/themes/default/html/views/login/login.php @@ -142,14 +142,14 @@ </label> </div> <div class="input"> - <div class="inputholder"><select id="<?php echo REQUEST_ID ?>_dbid" name="dbid" title="" class=""<?php if (count($dbids)<=1) echo ' disabled="disabled"'; ?> size=1"><?php include_once( 'modules/template-engine/components/html/selectbox/component-select-box.php') ?><?php component_select_option_list($dbids,$actdbid,0,0) ?><?php if (count($dbids)==0) { ?><input type="hidden" name="dbid" value="" /><?php } ?><?php if (count($dbids)==1) { ?><input type="hidden" name="dbid" value="<?php echo array_keys($dbids)[0] ?>" /><?php } ?> + <div class="inputholder"><select id="<?php echo REQUEST_ID ?>_dbid" name="dbid" title="" class=""<?php if (count($dbids)<=1) echo ' disabled="disabled"'; ?> size=1"><?php include_once( 'modules/template-engine/components/html/selectbox/component-select-box.php') ?><?php component_select_option_list($dbids,$dbid,0,0) ?><?php if (count($dbids)==0) { ?><input type="hidden" name="dbid" value="" /><?php } ?><?php if (count($dbids)==1) { ?><input type="hidden" name="dbid" value="<?php echo array_keys($dbids)[0] ?>" /><?php } ?> </select></div> </div> </div> </div></fieldset> <?php } ?> <?php if(!$if3){?> - <input type="hidden" name="dbid" value="<?php echo $actdbid ?>"/> + <input type="hidden" name="dbid" value="<?php echo $dbid ?>"/> <?php } ?> <input type="hidden" name="objectid" value="<?php echo $objectid ?>"/> diff --git a/modules/cms-ui/themes/default/html/views/login/login.tpl.src.xml b/modules/cms-ui/themes/default/html/views/login/login.tpl.src.xml @@ -144,14 +144,14 @@ </label> </part> <part class="input"> - <selectbox name="dbid" list="dbids" default="var:actdbid"></selectbox> + <selectbox name="dbid" list="dbids"></selectbox> </part> </part> </group> </if> <else> <!-- Nur 1 Datenbank zur Auswahl. Kein Auswahlfeld notwendig. --> - <hidden name="dbid" default="var:actdbid"></hidden> + <hidden name="dbid"></hidden> </else>