Change the ui per thumbs suggestion
Move the admin menu under the Settings dropdown Implement: * Vistors can create accounts but administrator approval is required * Email confirmations can be used or not used with above * Welcome email is sent when the user is created * Random password is generated when the user created and this is included in the welcome email.
This commit is contained in:
parent
496820034c
commit
0bdd2c2730
|
@ -32,8 +32,7 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
Kohana::log("alert", Kohana::debug($post));
|
Kohana::log("alert", Kohana::debug($post));
|
||||||
module::set_var("registration", "policy", $post->policy);
|
module::set_var("registration", "policy", $post->policy);
|
||||||
module::set_var("registration", "default_group", $post->group);
|
module::set_var("registration", "default_group", $post->group);
|
||||||
module::set_var("registration", "email_admin", !empty($post->email_admin));
|
module::set_var("registration", "email_verification", !empty($post->email_verification));
|
||||||
module::set_var("registration", "email_user", !empty($post->email_user));
|
|
||||||
|
|
||||||
message::success(t("Registration defaults have been updated."));
|
message::success(t("Registration defaults have been updated."));
|
||||||
|
|
||||||
|
@ -52,24 +51,27 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
$post = new Validation($_POST);
|
$post = new Validation($_POST);
|
||||||
$post->add_rules("activate_users", "required");
|
$post->add_rules("activate_users", "required");
|
||||||
if ($post->validate()) {
|
if ($post->validate()) {
|
||||||
|
$names = array();
|
||||||
foreach ($post->activate as $id) {
|
foreach ($post->activate as $id) {
|
||||||
$user = ORM::factory("pending_user", $id);
|
$user = ORM::factory("pending_user", $id);
|
||||||
Kohana::log("alert", Kohana::debug($user->as_array()));
|
Kohana::log("alert", Kohana::debug($user->as_array()));
|
||||||
|
|
||||||
$new_user = identity::create_user($user->name, $user->full_name, $user->password);
|
$password = md5(rand());
|
||||||
|
$new_user = identity::create_user($user->name, $user->full_name, $password);
|
||||||
$new_user->email = $user->email;
|
$new_user->email = $user->email;
|
||||||
$new_user->url = $user->url;
|
$new_user->url = $user->url;
|
||||||
$new_user->admin = false;
|
$new_user->admin = false;
|
||||||
$new_user->guest = false;
|
$new_user->guest = false;
|
||||||
$new_user->save();
|
$new_user->save();
|
||||||
|
|
||||||
// @todo add the user to the default group... requires new api method (add_user_to_group)
|
identity::add_user_to_group($new_user, module::get_var("registration", "default_group"));
|
||||||
identity::add_user_to_group($new_user, module::get_var("registration", "default_group"));
|
|
||||||
|
|
||||||
|
register::send_user_created_confirmation($new_user, $password);
|
||||||
|
$names[] = $user->name;
|
||||||
$user->delete();
|
$user->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
message::success(t("Activate users."));
|
message::success(t("Activated %users.", implode(", ", $names)));
|
||||||
|
|
||||||
$count = Database::instance()
|
$count = Database::instance()
|
||||||
->query("select count(id) as pending_count from {pending_users}")
|
->query("select count(id) as pending_count from {pending_users}")
|
||||||
|
@ -80,7 +82,6 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
url::redirect("admin/register");
|
url::redirect("admin/register");
|
||||||
}
|
}
|
||||||
|
|
||||||
Kohana::log("alert", Kohana::debug($post));
|
|
||||||
list ($form, $errors) = $this->_get_form();
|
list ($form, $errors) = $this->_get_form();
|
||||||
arr::overwrite($form, $post->as_array());
|
arr::overwrite($form, $post->as_array());
|
||||||
arr::overwrite($errors, $post->errors());
|
arr::overwrite($errors, $post->errors());
|
||||||
|
@ -91,12 +92,16 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
$v = new Admin_View("admin.html");
|
$v = new Admin_View("admin.html");
|
||||||
$v->content = new View("admin_register.html");
|
$v->content = new View("admin_register.html");
|
||||||
$v->content->action = "admin/register/update";
|
$v->content->action = "admin/register/update";
|
||||||
$v->content->policy_list = array("admin" => t("Activation by administrator"),
|
$v->content->policy_list =
|
||||||
"email" => t("Use confirmation emails"),
|
array("admin_only" => t("Only site administrators can create new user accounts."),
|
||||||
"immediate" => t("Accept without confirmation"));
|
"vistor" =>
|
||||||
|
t("Visitors can create accounts and no administrator approval is required."),
|
||||||
|
"admin_approval" =>
|
||||||
|
t("Visitors can create accounts but administrator approval is required."));
|
||||||
$admin = identity::admin_user();
|
$admin = identity::admin_user();
|
||||||
|
$v->content->no_admin = empty($admin->email) ? "disabled" : "";
|
||||||
if (empty($admin->email)) {
|
if (empty($admin->email)) {
|
||||||
unset($v->content->policy_list["email"]);
|
module::set_var("registration", "email_verification", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$v->content->group_list = array();
|
$v->content->group_list = array();
|
||||||
|
@ -110,7 +115,6 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
$v->content->group_list =
|
$v->content->group_list =
|
||||||
array("" => t("Choose the default group")) + $v->content->group_list;
|
array("" => t("Choose the default group")) + $v->content->group_list;
|
||||||
}
|
}
|
||||||
$v->content->no_admin = empty($admin->email);
|
|
||||||
$v->content->hidden = array("csrf" => access::csrf_token());
|
$v->content->hidden = array("csrf" => access::csrf_token());
|
||||||
$v->content->pending = ORM::factory("pending_user")->find_all();
|
$v->content->pending = ORM::factory("pending_user")->find_all();
|
||||||
$v->content->activate = "admin/register/activate";
|
$v->content->activate = "admin/register/activate";
|
||||||
|
@ -122,8 +126,7 @@ class Admin_register_Controller extends Admin_Controller {
|
||||||
private function _get_form() {
|
private function _get_form() {
|
||||||
$form = array("policy" => module::get_var("registration", "policy"),
|
$form = array("policy" => module::get_var("registration", "policy"),
|
||||||
"default_group" => module::get_var("registration", "default_group"),
|
"default_group" => module::get_var("registration", "default_group"),
|
||||||
"email_admin" => module::get_var("registration", "email_admin"),
|
"email_verification" => module::get_var("registration", "email_verification"));
|
||||||
"email_user" => module::get_var("registration", "email_user"));
|
|
||||||
$errors = array_fill_keys(array_keys($form), "");
|
$errors = array_fill_keys(array_keys($form), "");
|
||||||
|
|
||||||
return array($form, $errors);
|
return array($form, $errors);
|
||||||
|
|
|
@ -27,7 +27,6 @@ class register_Controller extends Controller {
|
||||||
$form = $this->_get_form();
|
$form = $this->_get_form();
|
||||||
$valid = $form->validate();
|
$valid = $form->validate();
|
||||||
|
|
||||||
// @todo create a user event "user_exists" which checks for name clashes
|
|
||||||
$name = $form->register_user->inputs["name"]->value;
|
$name = $form->register_user->inputs["name"]->value;
|
||||||
$user_exists_data = (object)array("name" => $name);
|
$user_exists_data = (object)array("name" => $name);
|
||||||
module::event("check_username_exists", $user_exists_data);
|
module::event("check_username_exists", $user_exists_data);
|
||||||
|
@ -36,26 +35,23 @@ class register_Controller extends Controller {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
if ($valid) {
|
if ($valid) {
|
||||||
switch (module::get_var("registration", "policy")) {
|
$pending_user = register::create_pending_request($form);
|
||||||
case "immediate":
|
$policy = module::get_var("registration", "policy");
|
||||||
message::success(t("Your registration request has been processed"));
|
if ($policy == "visitor" && $pending_user->confirmed) {
|
||||||
break;
|
// @todo create and logon
|
||||||
case "admin":
|
// set the form to the one similiar to the admin logon
|
||||||
$this->_create_pending_request($form);
|
} else if (empty($pending_user->confirmed) &&
|
||||||
message::success(t("Your registration request is awaiting administrator approval"));
|
($policy == "admin_approval" || $policy == "visitor")) {
|
||||||
|
register::send_confirmation($pending_user);
|
||||||
|
} else {
|
||||||
site_status::warning(
|
site_status::warning(
|
||||||
t("There are pending user registration. <a href=\"%url\">Review now!</a>",
|
t("There are pending user registration. <a href=\"%url\">Review now!</a>",
|
||||||
array("url" => html::mark_clean(url::site("admin/register")))),
|
array("url" => html::mark_clean(url::site("admin/register")))),
|
||||||
"pending_user_registrations");
|
"pending_user_registrations");
|
||||||
|
message::success(t("Your registration request is awaiting administrator approval"));
|
||||||
break;
|
|
||||||
case "email":
|
|
||||||
message::success(t("A confirmation email has been sent to the email address you provided."));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print json_encode(
|
print json_encode(array("result" => "success"));
|
||||||
array("result" => "success"));
|
|
||||||
} else {
|
} else {
|
||||||
print json_encode(
|
print json_encode(
|
||||||
array("result" => "error",
|
array("result" => "error",
|
||||||
|
@ -63,16 +59,29 @@ class register_Controller extends Controller {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _create_pending_request($form) {
|
public function confirm($hash) {
|
||||||
$user = ORM::factory("pending_user");
|
$pending_user = ORM::factory("pending_user")
|
||||||
$user->name = $form->register_user->inputs["name"]->value;
|
->where("hash", $hash)
|
||||||
$user->full_name = $form->register_user->inputs["full_name"]->value;
|
->find();
|
||||||
// @todo call identity to hash the password
|
if ($pending_user->loaded) {
|
||||||
$user->password = $form->register_user->inputs["password"]->value;
|
// @todo add a request date to the pending user table and check that it hasn't expired
|
||||||
$user->email = $form->register_user->inputs["email"]->value;
|
$policy = module::get_var("registration", "policy");
|
||||||
$user->url = $form->register_user->inputs["url"]->value;
|
$pending_user->confirmed = true;
|
||||||
$user->hash = md5(rand());
|
$pending_user->save();
|
||||||
$user->save();
|
if ($policy == "vistor") {
|
||||||
|
// @todo create and logon
|
||||||
|
// set the form to the one similiar to the admin logon
|
||||||
|
} else {
|
||||||
|
site_status::warning(
|
||||||
|
t("There are pending user registration. <a href=\"%url\">Review now!</a>",
|
||||||
|
array("url" => html::mark_clean(url::site("admin/register")))),
|
||||||
|
"pending_user_registrations");
|
||||||
|
message::success(t("Your registration request is awaiting administrator approval"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message::error(t("Your registration request is no longer valid, Please re-register."));
|
||||||
|
}
|
||||||
|
url::redirect(item::root()->abs_url());
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _get_form() {
|
private function _get_form() {
|
||||||
|
@ -84,12 +93,8 @@ class register_Controller extends Controller {
|
||||||
->error_messages("in_use", t("There is already a user with that username"));
|
->error_messages("in_use", t("There is already a user with that username"));
|
||||||
$group->input("full_name")->label(t("Full Name"))->id("g-fullname")
|
$group->input("full_name")->label(t("Full Name"))->id("g-fullname")
|
||||||
->rules("length[0, 255]");
|
->rules("length[0, 255]");
|
||||||
$group->password("password")->label(t("Password"))->id("g-password")
|
|
||||||
->rules("required|length[{$minimum_length}, 40]");
|
|
||||||
$group->password("password2")->label(t("Confirm Password"))->id("g-password2")
|
|
||||||
->matches($group->password);
|
|
||||||
$group->input("email")->label(t("Email"))->id("g-email")
|
$group->input("email")->label(t("Email"))->id("g-email")
|
||||||
->rules("valid_email|length[1,255]");
|
->rules("required|valid_email|length[1,255]");
|
||||||
$group->input("email2")->label(t("Confirm email"))->id("g-email2")
|
$group->input("email2")->label(t("Confirm email"))->id("g-email2")
|
||||||
->matches($group->email);
|
->matches($group->email);
|
||||||
$group->input("url")->label(t("URL"))->id("g-url")
|
$group->input("url")->label(t("URL"))->id("g-url")
|
||||||
|
|
60
modules/register/helpers/register.php
Normal file
60
modules/register/helpers/register.php
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.");
|
||||||
|
/**
|
||||||
|
* Gallery - a web based photo album viewer and editor
|
||||||
|
* Copyright (C) 2000-2009 Bharat Mediratta
|
||||||
|
*
|
||||||
|
* 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, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
class register_Core {
|
||||||
|
static function send_user_created_confirmation($user, $password) {
|
||||||
|
$message = new View("register_welcome.html");
|
||||||
|
$message->user = $user;
|
||||||
|
$message->password = $password;
|
||||||
|
self::_sendemail($user->email, t("Your userid has been created"), $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function send_confirmation($user) {
|
||||||
|
$message = new View("confirm_registration.html");
|
||||||
|
$message->confirm_url = url::abs_site("register/confirm/{$user->hash}");
|
||||||
|
$message->user = $user;
|
||||||
|
self::_sendemail($user->email, t("User registration confirmation"), $message);
|
||||||
|
}
|
||||||
|
|
||||||
|
static function create_pending_request($form) {
|
||||||
|
$email_verification = module::get_var("registration", "email_verification");
|
||||||
|
|
||||||
|
$user = ORM::factory("pending_user");
|
||||||
|
$user->name = $form->register_user->inputs["name"]->value;
|
||||||
|
$user->full_name = $form->register_user->inputs["full_name"]->value;
|
||||||
|
$user->email = $form->register_user->inputs["email"]->value;
|
||||||
|
$user->url = $form->register_user->inputs["url"]->value;
|
||||||
|
if (!$email_verification) {
|
||||||
|
$user->confirmed = true;
|
||||||
|
}
|
||||||
|
$user->hash = md5(rand());
|
||||||
|
$user->save();
|
||||||
|
return $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function _sendemail($email, $subject, $message) {
|
||||||
|
Sendmail::factory()
|
||||||
|
->to($email)
|
||||||
|
->subject($subject)
|
||||||
|
->header("Mime-Version", "1.0")
|
||||||
|
->header("Content-type", "text/html; charset=iso-8859-1")
|
||||||
|
->message($message->render())
|
||||||
|
->send();
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,17 +18,18 @@
|
||||||
*/
|
*/
|
||||||
class register_event {
|
class register_event {
|
||||||
static function admin_menu($menu, $theme) {
|
static function admin_menu($menu, $theme) {
|
||||||
$menu->get("identity_menu")
|
$menu->get("settings_menu")
|
||||||
->append( Menu::factory("link")
|
->append( Menu::factory("link")
|
||||||
->id("register_users")
|
->id("register_users")
|
||||||
->label(t("Self registration"))
|
->label(t("User registration"))
|
||||||
->url(url::site("admin/register")));
|
->url(url::site("admin/register")));
|
||||||
|
|
||||||
return $menu;
|
return $menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function site_menu($menu, $theme) {
|
static function site_menu($menu, $theme) {
|
||||||
if (identity::active_user()->guest) {
|
if (identity::active_user()->guest &&
|
||||||
|
module::get_var("registration", "policy") != "admin_only") {
|
||||||
$menu->append( Menu::factory("dialog")
|
$menu->append( Menu::factory("dialog")
|
||||||
->id("register_users")
|
->id("register_users")
|
||||||
->label(t("Register"))
|
->label(t("Register"))
|
||||||
|
|
|
@ -23,8 +23,8 @@ class register_installer {
|
||||||
$db->query("CREATE TABLE IF NOT EXISTS {pending_users} (
|
$db->query("CREATE TABLE IF NOT EXISTS {pending_users} (
|
||||||
`id` int(9) NOT NULL auto_increment,
|
`id` int(9) NOT NULL auto_increment,
|
||||||
`name` varchar(32) NOT NULL,
|
`name` varchar(32) NOT NULL,
|
||||||
|
`confirmed` boolean NOT NULL DEFAULT false,
|
||||||
`full_name` varchar(255) NOT NULL,
|
`full_name` varchar(255) NOT NULL,
|
||||||
`password` varchar(64) NOT NULL,
|
|
||||||
`email` varchar(64) default NULL,
|
`email` varchar(64) default NULL,
|
||||||
`hash` char(32) default NULL,
|
`hash` char(32) default NULL,
|
||||||
`url` varchar(255) default NULL,
|
`url` varchar(255) default NULL,
|
||||||
|
@ -33,10 +33,9 @@ class register_installer {
|
||||||
UNIQUE KEY(`name`))
|
UNIQUE KEY(`name`))
|
||||||
DEFAULT CHARSET=utf8;");
|
DEFAULT CHARSET=utf8;");
|
||||||
|
|
||||||
module::set_var("registration", "policy", "admin");
|
module::set_var("registration", "policy", "admin_only");
|
||||||
module::set_var("registration", "default_group", "");
|
module::set_var("registration", "default_group", "");
|
||||||
module::set_var("registration", "email_admin", true);
|
module::set_var("registration", "email_verification", true);
|
||||||
module::set_var("registration", "email_user", true);
|
|
||||||
|
|
||||||
module::set_version("register", 1);
|
module::set_version("register", 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
name = Self Registration
|
name = User Registration
|
||||||
description = "Allow anonymous users to register as users."
|
description = "Allow guests to register as users."
|
||||||
version = 1
|
version = 1
|
||||||
|
|
|
@ -1,55 +1,70 @@
|
||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<style>
|
||||||
|
#g-registration-admin li input[type=radio],
|
||||||
|
#g-registration-admin li input[type=checkbox] {
|
||||||
|
float: left;
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#g-registration-admin li label {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#g-registration-admin li h3 {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$("#g-active-pending-users").ready(function() {
|
||||||
|
$
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<div id="g-admin-register">
|
<div id="g-admin-register">
|
||||||
<div id="g-registration-admin" style="float: left">
|
<div id="g-registration-admin">
|
||||||
<h2><?= t("Registration adminstration") ?></h2>
|
<h2><?= t("Registration adminstration") ?></h2>
|
||||||
<?= form::open($action, array("method" => "post"), $hidden) ?>
|
<?= form::open($action, array("method" => "post"), $hidden) ?>
|
||||||
<ul>
|
<?= form::open_fieldset() ?>
|
||||||
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<h3><?= t("Confirmation policy") ?></h3>
|
<h3><?= t("Confirmation policy") ?></h3>
|
||||||
<p><?= t("The Gallery3 can accept new user registrations instantly, require the user to click a confirmation link in an email that is sent by the module, or require account activation by a site administrator.") ?><p/>
|
</li>
|
||||||
<?= form::label("policy", t("Choose policy")) ?>
|
<? foreach ($policy_list as $policy => $text): ?>
|
||||||
<?= form::dropdown(array("name" => "policy"), $policy_list, $form["policy"]) ?>
|
<li>
|
||||||
|
<?= form::radio("policy", $policy, $policy == $form["policy"]) ?>
|
||||||
|
<?= form::label("policy", $text) ?>
|
||||||
|
</li>
|
||||||
|
<? endforeach ?>
|
||||||
|
<li>
|
||||||
|
<?= form::checkbox("email_verification", "true", !empty($form["email_verification"]), $no_admin) ?>
|
||||||
|
<?= form::label("email_verification", t("Require e-mail verification when a visitor creates an account")) ?>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<h3><?= t("Default group") ?></h3>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<h3><?= t("Default Group") ?></h3>
|
|
||||||
<?= form::label("group", t("Set default group")) ?>
|
|
||||||
<?= form::dropdown(array("name" => "group"), $group_list, $form["default_group"]) ?>
|
<?= form::dropdown(array("name" => "group"), $group_list, $form["default_group"]) ?>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<h3><?= t("Send email policy") ?></h3>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<? if (empty($no_admin)): ?>
|
|
||||||
<?= form::label("email_admin", t("Email administrator for all new registrations")) ?>
|
|
||||||
<?= form::checkbox("email_admin", "true", !empty($form["email_admin"])) ?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?= form::label("email_user", t("Send confirmation email on account activation")) ?>
|
|
||||||
<?= form::checkbox("email_user", "true", !empty($form["email_user"])) ?>
|
|
||||||
<? else: ?>
|
|
||||||
<span <? if (!empty($errors["email_admin"])): ?> class="g-error"<? endif ?>>
|
|
||||||
<?= form::hidden(array("name" => "email_admin", "value" => "")) ?>
|
|
||||||
<?= form::hidden(array("name" => "email_user", "value" => "")) ?>
|
|
||||||
<p class="g-error"><?= t("Unable to set email policies as the administrator email has not been set.") ?></p>
|
|
||||||
</span>
|
|
||||||
<?endif ?>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<?= form::submit(array("id" => "g-registration-admin", "name" => "save", "class" => "submit", "style" => "clear:both!important"), t("Update")) ?>
|
<?= form::submit(array("id" => "g-registration-admin", "name" => "save", "class" => "submit", "style" => "clear:both!important"), t("Update")) ?>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?= form::close_fieldset() ?>
|
||||||
<?= form::close() ?>
|
<?= form::close() ?>
|
||||||
</div>
|
</div>
|
||||||
<? if (count($pending)): ?>
|
<? if (count($pending)): ?>
|
||||||
<div id="g-activate-pending-users" style="float: left; margin-top: .5em">
|
<div id="g-activate-pending-users" style="margin-top: .5em">
|
||||||
<h2><?= t("Pending account activations") ?></h2>
|
|
||||||
<?= form::open($activate, array("method" => "post"), $hidden) ?>
|
<?= form::open($activate, array("method" => "post"), $hidden) ?>
|
||||||
<ul>
|
<?= form::open_fieldset() ?>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<h3><?= t("Pending account activations") ?></h3>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= t("Activate") ?></td>
|
<td><?= t("Activate") ?></td>
|
||||||
|
<td><?= t("Confirmed") ?></td>
|
||||||
<td><?= t("User name") ?></td>
|
<td><?= t("User name") ?></td>
|
||||||
<td><?= t("Full name") ?></td>
|
<td><?= t("Full name") ?></td>
|
||||||
<td><?= t("Email") ?></td>
|
<td><?= t("Email") ?></td>
|
||||||
|
@ -58,6 +73,7 @@
|
||||||
<? foreach ($pending as $user): ?>
|
<? foreach ($pending as $user): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= form::checkbox("activate[]", $user->id) ?>
|
<td><?= form::checkbox("activate[]", $user->id) ?>
|
||||||
|
<td><?= form::checkbox("confirmed[$user->id]", "checked", $user->confirmed, "disabled") ?></td>
|
||||||
<td><?= t($user->name) ?></td>
|
<td><?= t($user->name) ?></td>
|
||||||
<td><?= t($user->full_name) ?></td>
|
<td><?= t($user->full_name) ?></td>
|
||||||
<td><?= t($user->email) ?></td>
|
<td><?= t($user->email) ?></td>
|
||||||
|
@ -69,6 +85,7 @@
|
||||||
<?= form::submit(array("id" => "g-registration-activate", "name" => "activate_users", "class" => "submit", "style" => "clear:both!important"), t("Activate")) ?>
|
<?= form::submit(array("id" => "g-registration-activate", "name" => "activate_users", "class" => "submit", "style" => "clear:both!important"), t("Activate")) ?>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?= form::close_fieldset() ?>
|
||||||
<?= form::close() ?>
|
<?= form::close() ?>
|
||||||
</div>
|
</div>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
|
|
17
modules/register/views/confirm_registration.html.php
Normal file
17
modules/register/views/confirm_registration.html.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><?= t("User registration confirmation") ?> </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2><?= t("User registration confirmation") ?> </h2>
|
||||||
|
<p>
|
||||||
|
<?= t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?= t("We received a request to to create a user with this email. If you made this request, you can confirm it by <a href=\"%confirm_url\">clicking this link</a>. If you didn't request this password reset, it's ok to ignore this mail.",
|
||||||
|
array("site_url" => html::mark_clean(url::base(false, "http")),
|
||||||
|
"confirm_url" => $confirm_url)) ?>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
17
modules/register/views/register_welcome.html.php
Normal file
17
modules/register/views/register_welcome.html.php
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><?= t("Welcome to Gallery3") ?> </title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2><?= t("Welcome") ?> </h2>
|
||||||
|
<p>
|
||||||
|
<?= t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<?= t("The user account you requested as been created.<br/>The password to your account is %password. We suggest you change it on your next visit. <br/>You can access the site by <a href=\"%site_url\">clicking this link</a>.",
|
||||||
|
array("site_url" => html::mark_clean(url::base(false, "http")),
|
||||||
|
"password" => $password)) ?>
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user