Merge commit 'gallery3-contrib/master'
This commit is contained in:
commit
a6b2b6408a
@ -18,15 +18,19 @@
|
||||
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
class ldap_installer {
|
||||
static function install() {
|
||||
module::set_version("ldap", 1);
|
||||
$root = item::root();
|
||||
$ldap_provider = new IdentityProvider("ldap");
|
||||
foreach ($ldap_provider->groups() as $group) {
|
||||
module::event("group_created", $group);
|
||||
access::allow($group, "view", $root);
|
||||
access::allow($group, "view_full", $root);
|
||||
static function can_activate() {
|
||||
$messages = array();
|
||||
if (array_search("ldap", get_loaded_extensions()) === false) {
|
||||
$messages["error"][] =
|
||||
t("Cannot install LDAP identity provider as the PHP LDAP extension module is not enabled.");
|
||||
} else {
|
||||
$messages["warn"][] = IdentityProvider::confirmation_message();
|
||||
}
|
||||
return $messages;
|
||||
}
|
||||
|
||||
static function install() {
|
||||
IdentityProvider::change_provider("ldap");
|
||||
}
|
||||
|
||||
static function uninstall() {
|
||||
@ -36,4 +40,14 @@ class ldap_installer {
|
||||
module::event("group_deleted", $group);
|
||||
}
|
||||
}
|
||||
|
||||
static function initialize() {
|
||||
module::set_version("ldap", 1);
|
||||
$root = item::root();
|
||||
foreach (IdentityProvider::instance()->groups() as $group) {
|
||||
module::event("group_created", $group);
|
||||
access::allow($group, "view", $root);
|
||||
access::allow($group, "view_full", $root);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
name = "LDAP"
|
||||
description = "Use LDAP for authentication"
|
||||
version = 1
|
||||
|
||||
; Don't show this module on the module administration screen
|
||||
no_module_admin = 1
|
||||
|
@ -161,4 +161,17 @@ class user_homes_event_Core {
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static function show_user_profile($data) {
|
||||
$home = ORM::factory("user_home")->where("id", "=", $data->user->id)->find();
|
||||
|
||||
if ($home->loaded()) {
|
||||
$view = new View("user_profile_home.html");
|
||||
$item = ORM::factory("item")->where("id", "=", $home->home)->find();
|
||||
if ($item->loaded()) {
|
||||
$view->item = $item;
|
||||
$data->content[] = (object)array("title" => t("Home album"), "view" => $view);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
modules/user_homes/views/user_profile_home.html.php
Normal file
10
modules/user_homes/views/user_profile_home.html.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<div id="g-user-home-detail">
|
||||
<ul>
|
||||
<li id="g-user_home-<?= $item->id ?>">
|
||||
<a href="<?= $item->url() ?>">
|
||||
<?= html::purify($item->title) ?>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user