summaryrefslogtreecommitdiff
path: root/modules/gallery/views
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/views')
-rw-r--r--modules/gallery/views/admin_identity.html.php61
-rw-r--r--modules/gallery/views/admin_identity_confirm.html.php10
-rw-r--r--modules/gallery/views/kohana_error_page.php2
-rw-r--r--modules/gallery/views/login.html.php4
-rw-r--r--modules/gallery/views/login_ajax.html.php2
-rw-r--r--modules/gallery/views/maintenance.html.php2
6 files changed, 79 insertions, 2 deletions
diff --git a/modules/gallery/views/admin_identity.html.php b/modules/gallery/views/admin_identity.html.php
new file mode 100644
index 00000000..358860cf
--- /dev/null
+++ b/modules/gallery/views/admin_identity.html.php
@@ -0,0 +1,61 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#g-modules form").submit(function() {
+ var eDialog = '<div id="g-dialog"></div>';
+ var params = $(this).serialize();
+ var url = $(this).attr("action");
+ $("body").append(eDialog);
+ $.post($(this).attr("action"), $(this).serialize(), function(data, textStatus) {
+ $("#g-dialog").html(data);
+ $("#g-dialog").dialog({
+ bgiframe: true,
+ title: <?= t("Confirm identity provider change")->for_js() ?>,
+ resizable: false,
+ height:165,
+ modal: true,
+ overlay: {
+ backgroundColor: '#000',
+ opacity: 0.5
+ },
+ buttons: {
+ "Continue": function() {
+ $("##g-dialog form").submit();
+ },
+ Cancel: function() {
+ $(this).dialog('close');
+ }
+ }
+ });
+ });
+ return false;
+ });
+ });
+
+</script>
+<div id="g-modules">
+ <h1> <?= t("Manage Identity Providers") ?> </h1>
+ <p>
+ <?= t("Choose a different user/group management provider.") ?>
+ </p>
+
+ <form method="post" action="<?= url::site("admin/identity/confirm") ?>">
+ <?= access::csrf_form_field() ?>
+ <table>
+ <tr>
+ <th> <?= t("Active") ?> </th>
+ <th> <?= t("Description") ?> </th>
+ </tr>
+ <? $i = 0 ?>
+ <? foreach ($available as $module_name => $description): ?>
+ <tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
+ <? $data = array("name" => "provider"); ?>
+ <td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td>
+ <td> <?= t($description) ?> </td>
+ </tr>
+ <? $i++ ?>
+ <? endforeach ?>
+ </table>
+ <input type="submit" value="<?= t("Change")->for_html_attr() ?>" />
+ </form>
+</div>
diff --git a/modules/gallery/views/admin_identity_confirm.html.php b/modules/gallery/views/admin_identity_confirm.html.php
new file mode 100644
index 00000000..54aae9c8
--- /dev/null
+++ b/modules/gallery/views/admin_identity_confirm.html.php
@@ -0,0 +1,10 @@
+<?php defined("SYSPATH") or die("No direct script access.") ?>
+<form method="post" action="<?= url::site("admin/identity/change") ?>">
+ <?= access::csrf_form_field() ?>
+ <?= form::hidden("provider", $new_provider) ?>
+
+ <p><span class="ui-icon ui-icon-alert" style="float: left; margin:0 7px 20px 0;"></span>
+ <?= t("Are you sure you want to change your Identity Provider? Continuing will delete all existing users.") ?>
+ </p>
+</form>
+
diff --git a/modules/gallery/views/kohana_error_page.php b/modules/gallery/views/kohana_error_page.php
index 314a9923..0d8801e5 100644
--- a/modules/gallery/views/kohana_error_page.php
+++ b/modules/gallery/views/kohana_error_page.php
@@ -57,7 +57,7 @@
<title><?= t("Something went wrong!") ?></title>
</head>
<body>
- <? try { $user = user::active(); } catch (Exception $e) { } ?>
+ <? try { $user = identity::active_user(); } catch (Exception $e) { } ?>
<? $admin = php_sapi_name() == "cli" || isset($user) && $user->admin ?>
<div class="big_box" id="framework_error">
<h1>
diff --git a/modules/gallery/views/login.html.php b/modules/gallery/views/login.html.php
index 3b327e31..ae709c7c 100644
--- a/modules/gallery/views/login.html.php
+++ b/modules/gallery/views/login.html.php
@@ -8,11 +8,15 @@
</li>
<? else: ?>
<li class="first">
+ <? if (identity::is_writable()): ?>
<?= t('Logged in as %name', array('name' => html::mark_clean(
'<a href="' . url::site("form/edit/users/{$user->id}") .
'" title="' . t("Edit Your Profile")->for_html_attr() .
'" id="g-user-profile-link" class="g-dialog-link">' .
html::clean($user->display_name()) . '</a>'))) ?>
+ <? else: ?>
+ <?= t('Logged in as %name', array('name' => html::clean($user->display_name()))) ?>
+ <? endif ?>
</li>
<li>
<a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(url::current(true))) ?>"
diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php
index d3364b46..a9a9ef11 100644
--- a/modules/gallery/views/login_ajax.html.php
+++ b/modules/gallery/views/login_ajax.html.php
@@ -36,8 +36,10 @@
<li id="g-login-form">
<?= $form ?>
</li>
+ <? if (identity::is_writable()): ?>
<li>
<a href="#" id="g-password-reset" class="g-right g-txt-small"><?= t("Forgot Your Password?") ?></a>
</li>
+ <? endif ?>
</ul>
</div>
diff --git a/modules/gallery/views/maintenance.html.php b/modules/gallery/views/maintenance.html.php
index f80b6e7a..0aeaaec2 100644
--- a/modules/gallery/views/maintenance.html.php
+++ b/modules/gallery/views/maintenance.html.php
@@ -43,7 +43,7 @@
<p>
<?= t("This site is currently only accessible by site administrators.") ?>
</p>
- <?= user::get_login_form("login/auth_html") ?>
+ <?= login::get_login_form("login/auth_html") ?>
</body>
</html>