Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide user profiles #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ding_panels/ding_panels.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name = Ding! Panels
description = Provides Panels plug-ins. Content types, layouts, etc.
package = Ding!
core = 6.x
dependencies[] = panels

name = "Ding! Panels"
description = "Provides Panels plug-ins. Content types, layouts, etc."
core = "6.x"
package = "Ding!"
dependencies[] = "panels"
dependencies[] = "strongarm"
features[ctools][] = "strongarm:strongarm:1"
features[variable][] = "site_403"
6 changes: 6 additions & 0 deletions ding_panels/ding_panels.module
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ function ding_panels_ctools_plugin_api($module, $api) {
if ($module == 'panels' && $api == 'styles') {
return array('version' => 2);
}
elseif ($module == "page_manager" && $api == "pages_default") {
return array("version" => 1);
}
elseif ($module == "strongarm" && $api == "strongarm") {
return array("version" => 1);
}
}

/**
Expand Down
97 changes: 97 additions & 0 deletions ding_panels/ding_panels.pages_default.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?php

/**
* Implementation of hook_default_page_manager_handlers().
*/
function ding_panels_default_page_manager_handlers() {
$export = array();

$page = new stdClass;
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'ding_403_access_denied';
$page->task = 'page';
$page->admin_title = 'Access denied page';
$page->admin_description = 'Generic access denied page.';
$page->path = 'error/403';
$page->access = array();
$page->menu = array();
$page->arguments = array();
$page->conf = array();
$page->default_handlers = array();
$handler = new stdClass;
$handler->disabled = FALSE; /* Edit this to true to make a default handler disabled initially */
$handler->api_version = 1;
$handler->name = 'page_ding_403_access_denied_panel_context';
$handler->task = 'page';
$handler->subtask = 'ding_403_access_denied';
$handler->handler = 'panel_context';
$handler->weight = 0;
$handler->conf = array(
'title' => 'Panel',
'no_blocks' => 0,
'pipeline' => 'standard',
'css_id' => 'ding-403-access-denied',
'css' => '',
'contexts' => array(),
'relationships' => array(),
);
$display = new panels_display;
$display->layout = 'onecol';
$display->layout_settings = array();
$display->panel_settings = array();
$display->cache = array();
$display->title = 'Adgang nægtet';
$display->content = array();
$display->panels = array();
$pane = new stdClass;
$pane->pid = 'access-denied-text';
$pane->panel = 'middle';
$pane->type = 'custom';
$pane->subtype = 'custom';
$pane->shown = TRUE;
$pane->access = array();
$pane->configuration = array(
'admin_title' => 'Basic access denied message',
'title' => '',
'body' => 'Du har ikke adgang til at se denne side.',
'format' => '1',
'substitute' => TRUE,
);
$pane->cache = array();
$pane->style = array();
$pane->css = array();
$pane->extras = array();
$pane->position = 0;
$display->content['access-denied-text'] = $pane;
$display->panels['middle'][0] = 'access-denied-text';
$pane = new stdClass;
$pane->pid = 'login-in-text';
$pane->panel = 'middle';
$pane->type = 'custom';
$pane->subtype = 'custom';
$pane->shown = TRUE;
$pane->access = FALSE;
$pane->configuration = array(
'admin_title' => 'Please log in-text',
'title' => '',
'body' => 'Du er ikke logget ind. Brug login-formularen øverst på siden for at logge ind.',
'format' => '1',
'substitute' => TRUE,
);
$pane->cache = array();
$pane->style = array();
$pane->css = array();
$pane->extras = array();
$pane->position = 1;
$display->content['login-in-text'] = $pane;
$display->panels['middle'][1] = 'login-in-text';
$display->hide_title = PANELS_TITLE_FIXED;
$display->title_pane = 'access-denied-text';
$handler->conf['display'] = $display;
$page->default_handlers[$handler->name] = $handler;

$export['ding_403_access_denied'] = $handler;

return $export;
}
17 changes: 17 additions & 0 deletions ding_panels/ding_panels.strongarm.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

/**
* Implementation of hook_strongarm().
*/
function ding_panels_strongarm() {
$export = array();

$strongarm = new stdClass;
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
$strongarm->api_version = 1;
$strongarm->name = 'site_403';
$strongarm->value = 'error/403';
$export['site_403'] = $strongarm;

return $export;
}
30 changes: 30 additions & 0 deletions ding_user/ding_user.install
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,33 @@ function ding_user_update_6002() {
return $ret;
}

/**
* Remove path alias from alma users.
*/
function ding_user_update_6003() {
$ret = array();

$user_count = (integer) db_result(db_query("SELECT COUNT(uid) FROM {users} AS u WHERE u.name LIKE '%@alma_user'"));

$uid_query = db_query("SELECT uid FROM {users} AS u WHERE u.name LIKE '%@alma_user'");

// Make buckets of 50 uids, so we don't have to make a query for each user.
$bucket_count = ceil($user_count / 50);
$uids = array();
while ($uid = (integer) db_result($uid_query)) {
$uids[$uid % $bucket_count][] = $uid;
}

// Remove aliases for each bucket.
foreach ($uids as $bucket) {
$filter = array();

foreach ($bucket as $uid) {
$filter[] = 'user/' . $uid;
}

$ret[] = update_sql("DELETE FROM {url_alias} WHERE src IN ('" . implode("','", $filter) . "')");
}

return $ret;
}
Loading