From d59dea9fddf885a836f7dc2d8be1f93afb7e9542 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 25 Feb 2014 20:00:56 +0100 Subject: added new html_denied() method as well --- inc/html.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index fcec29670..507ba511e 100644 --- a/inc/html.php +++ b/inc/html.php @@ -64,6 +64,25 @@ function html_login(){ print ''.NL; } + +/** + * Denied page content + * + * @return string html + */ +function html_denied() { + global $lang; + $denied = p_locale_xhtml('denied'); + $notloggedin = isset($_SERVER['REMOTE_USER']) ? '' : $lang['notloggedin']; + + $denied = str_replace( + array('@NOTLOGGEDIN@'), + array($notloggedin), + $denied + ); + print $denied; +} + /** * inserts section edit buttons if wanted or removes the markers * -- cgit v1.2.3 From f019ab46c33b430831053cd41b5b04a163fd529f Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 4 Mar 2014 21:27:10 +0100 Subject: added login form at denied access page - restore lang string as well --- inc/html.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 507ba511e..514f961e7 100644 --- a/inc/html.php +++ b/inc/html.php @@ -81,6 +81,10 @@ function html_denied() { $denied ); print $denied; + + if(!$_SERVER['REMOTE_USER']){ + html_login(); + } } /** -- cgit v1.2.3 From 0e80bb5e347ff00c6f81627d8e39dafaaa923bc5 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Wed, 5 Mar 2014 21:58:46 +0000 Subject: use empty() where array values might not be set --- inc/html.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index fcec29670..41f26e5cd 100644 --- a/inc/html.php +++ b/inc/html.php @@ -691,7 +691,7 @@ function html_recent($first=0, $show_changes='both'){ $form->addElement(form_makeOpenTag('div', array('class' => 'li'))); - if ($recent['media']) { + if (!empty($recent['media'])) { $form->addElement(media_printicon($recent['id'])); } else { $icon = DOKU_BASE.'lib/images/fileicons/file.png'; @@ -705,7 +705,7 @@ function html_recent($first=0, $show_changes='both'){ $diff = false; $href = ''; - if ($recent['media']) { + if (!empty($recent['media'])) { $diff = (count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id']))); if ($diff) { $href = media_managerURL(array('tab_details' => 'history', @@ -715,7 +715,7 @@ function html_recent($first=0, $show_changes='both'){ $href = wl($recent['id'],"do=diff", false, '&'); } - if ($recent['media'] && !$diff) { + if (!empty($recent['media']) && !$diff) { $form->addElement(''); } else { $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href))); @@ -729,7 +729,7 @@ function html_recent($first=0, $show_changes='both'){ $form->addElement(form_makeCloseTag('a')); } - if ($recent['media']) { + if (!empty($recent['media'])) { $href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); } else { @@ -745,7 +745,7 @@ function html_recent($first=0, $show_changes='both'){ ))); $form->addElement(form_makeCloseTag('a')); - if ($recent['media']) { + if (!empty($recent['media'])) { $href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&'); $class = (file_exists(mediaFN($recent['id']))) ? 'wikilink1' : $class = 'wikilink2'; $form->addElement(form_makeOpenTag('a', array('class' => $class, 'href' => $href))); -- cgit v1.2.3 From d1e9181ef12479db0c36d6d93f0ecff84523bf73 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 6 Mar 2014 23:50:05 +0100 Subject: removed 'not logged in' text, loginform is shown already --- inc/html.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'inc/html.php') diff --git a/inc/html.php b/inc/html.php index 514f961e7..4a355bdaf 100644 --- a/inc/html.php +++ b/inc/html.php @@ -71,16 +71,7 @@ function html_login(){ * @return string html */ function html_denied() { - global $lang; - $denied = p_locale_xhtml('denied'); - $notloggedin = isset($_SERVER['REMOTE_USER']) ? '' : $lang['notloggedin']; - - $denied = str_replace( - array('@NOTLOGGEDIN@'), - array($notloggedin), - $denied - ); - print $denied; + print p_locale_xhtml('denied'); if(!$_SERVER['REMOTE_USER']){ html_login(); -- cgit v1.2.3