News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Tutorial] Instalar manualmente el mod Member Specific Permissions (SMF 1.1.11)

Started by Herr_Inoddorell, April 05, 2010, 08:05:27 PM

Previous topic - Next topic

Herr_Inoddorell

Modificación: Member Specific Permissions v 1.32

Autor del mod: Grudge.




Como verán este mod nos permite agregar/denegar permisos para algún determinado usuario, sin necesidad de aplicar dichos permisos a todo el grupo. Como el mod es un tanto viejo y la ultima actualización data del 2005, acá les dejo una guia para poder instalar manualmente esta modificación.


Instalación

Antes de la modificación manual de los archivos, vamos a generar una consulta en phpmyadmin.

Entrar al phpmyadmin -> Click en Generar Consulta -> En el campo donde dice Consulta a la base de datos [Nombre de la base de datos], ingresar la siguiente consulta, y luego apretar el botón Ejecutar la consulta.

Consulta:


CREATE TABLE IF NOT EXISTS smf_member_permissions (
`ID_BOARD` smallint(5) NOT NULL default '-1',
`permission` varchar(24) NOT NULL default '',
`addDeny` tinyint(4) NOT NULL default '1',
`ID_MEMBER` int(11) NOT NULL default '-1',
PRIMARY KEY (`ID_BOARD`,`permission`) ) TYPE=MyISAM



Ahora sí, empezamos con la modificación manual de los siguientes archivos.

En el archivo ./Sources/Security.php

Buscar:


$boards = array_values(array_diff($boards, $deny_boards));


Añadir antes:

// Handle member specific permissions - for local boards.
$request = db_query("
SELECT ID_BOARD, addDeny
FROM {$db_prefix}member_permissions
WHERE ID_MEMBER = $ID_MEMBER
AND permission = '$permission'
ORDER BY addDeny DESC, ID_BOARD", __FILE__, __LINE__);
// This is used to override denys!
$remove = array();
while ($row = mysql_fetch_assoc($request))
{
if (empty($row['addDeny']))
{
// Global - remove all current $boards entries!
if ($row['ID_BOARD'] == 0)
$boards = array();
else
$deny_boards[] = $row['ID_BOARD'];
}
else
{
// Allow everything!
if ($row['ID_BOARD'] == 0)
{
$boards += $deny_boards;
$deny_boards = array();
}
else
{
$boards[] = $row['ID_BOARD'];
// Member permissions override even a Deny!
$remove = array_merge(array_keys($deny_boards, $row['ID_BOARD']), $remove);
}
}
}
mysql_free_result($request);
foreach ($remove as $key)
unset($deny_boards[$key]);




En el archivo ./Sources/Load.php

Buscar:


$user_info['permissions'] = array_diff($user_info['permissions'], $permission_mode[$board_info['permission_mode']]);
}


Añadir después:

$ID_MEMBER = $GLOBALS['ID_MEMBER'];

$request = db_query("
SELECT permission, addDeny
FROM {$db_prefix}member_permissions
WHERE ID_MEMBER = $ID_MEMBER
AND (" . (empty($board) ? '' : 'ID_BOARD = 0 OR ID_BOARD = ' . $board . ' OR ') . " ID_BOARD = -1)
ORDER BY addDeny DESC, ID_BOARD", __FILE__, __LINE__);
$remove = array();
while ($row = mysql_fetch_assoc($request))
{
if (empty($row['addDeny']))
$remove[$row['permission']] = $row['permission'];
else
{
$user_info['permissions'][] = $row['permission'];
}
}
mysql_free_result($request);

$user_info['permissions'] = array_unique($user_info['permissions']);
// Remove the old ones as needed.
foreach ($user_info['permissions'] as $key => $value)
{
if (isset($remove[$value]))
unset($user_info['permissions'][$key]);
}


En el archivo ./Themes/default/Profile.template.php

Buscar:


}
echo '
</table><br />';


Añadir después:


echo '
<br />
<script language="JavaScript1.2" type="text/javascript"><!--
function showBoxes()
{
if (document.getElementById("type").value == "board")
{
document.getElementById("general_display").style.display = "none";
document.getElementById("board_display").style.display = "";
document.getElementById("board_display2").style.display = "";
}
else
{
document.getElementById("general_display").style.display = "";
document.getElementById("board_display").style.display = "none";
document.getElementById("board_display2").style.display = "none";
}
}
--></script>
<form action="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showPermissions" method="post">
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td width="10"><input type="checkbox" name="delete" class="check" onclick="invertAll(this, this.form);"/></td>
<td colspan="2">', $txt['memberPermissions_general'], '</td>
</tr>';
if (!empty($context['member']['specific_member_permissions']))
{
$alternate = true;
foreach ($context['member']['specific_member_permissions'] as $permission)
{
echo '
<tr class="', $alternate ? 'windowbg2' : 'windowbg', '">
<td width="10"><input type="checkbox" name="delete[-1][', $permission['id'], ']" class="check" /></td>
<td colspan="2" ', $permission['denied'] ? ' style="text-decoration: line-through;"' : '', '>', $permission['name'], ' <i>(', $permission['id'], ')</i></td>
</tr>';
$alternate = !$alternate;
}
}
else
{
echo '
<tr class="windowbg2">
<td colspan="3">', $txt['memberPermissions_none'], '</td>
</tr>';
}
echo '
<tr class="titlebg">
<td width="10"></td>
<td>', $txt['memberPermissions_board'], '</td>
<td>', $txt['memberPermissions_where'], '</td>
</tr>';
if (!empty($context['member']['specific_board_permissions']))
{
$alternate = true;
foreach ($context['member']['specific_board_permissions'] as $permission)
{
echo '
<tr class="', $alternate ? 'windowbg2' : 'windowbg', '">
<td width="10"><input type="checkbox" name="delete[', $permission['board_id'], '][', $permission['id'], ']" class="check" /></td>
<td', $permission['denied'] ? ' style="text-decoration: line-through;"' : '', '>', $permission['name'], ' <i>(', $permission['id'], ')</i></td>
<td>', $permission['board'], '</td>
</tr>';
$alternate = !$alternate;
}
}
else
{
echo '
<tr class="windowbg2">
<td colspan="3">', $txt['memberPermissions_none'], '</td>
</tr>';
}

echo '
<tr class="titlebg">
<td colspan="3" align="right">
<input type="submit" name="conf_delete" value="', $txt['quickmod_delete_selected'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');" />
</td>
</tr>
</table>
<br />
<table width="90%" border="0" cellspacing="1" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td colspan="2">', $txt['memberPermissions_add'], '</td>
</tr>
<tr class="windowbg">
<td align="right">', $txt['memberPermissions_type'], ':</td>
<td align="left">
<select name="type" id="type" onchange="showBoxes();">
<option value="">', $txt['memberPermissions_select'], '</option>
<option value="general">', $txt['memberPermissions_general'], '</option>
<option value="board">', $txt['memberPermissions_board'], '</option>
</select>
</td>
</tr>
<tr class="windowbg" id="board_display" style="display: none">
<td align="right">', $txt['memberPermissions_board_select'], ':</td>
<td align="left">
<select name="board4p" id="board4p">
<option value="">', $txt['memberPermissions_select'], '</option>
<option value="0"><b>', $txt['memberPermissions_all'], '</b></option>';
if (!empty($context['mems_boards']))
foreach ($context['mems_boards'] as $curBoard)
echo '
<option value="', $curBoard['id'], '">', $curBoard['name'], '</option>';
echo '
</select>
</td>
</tr>
<tr class="windowbg" id="board_display2" style="display: none">
<td align="right">', $txt['memberPermissions_permission'], ':</td>
<td align="left">
<select name="bpermission" id="bpermission">
<option value="">', $txt['memberPermissions_select'], '</option>';
if (!empty($context['boardPerms']))
foreach ($context['boardPerms'] as $id => $name)
echo '
<option value="', $id, '">', $name, '</option>';
echo '
</select>
</td>
</tr>
<tr class="windowbg" id="general_display" style="display: none">
<td align="right">', $txt['memberPermissions_permission'], ':</td>
<td align="left">
<select name="gpermission">
<option value="">', $txt['memberPermissions_select'], '</option>';
if (!empty($context['generalPerms']))
foreach ($context['generalPerms'] as $id => $name)
echo '
<option value="', $id, '">', $name, '</option>';
echo '
</select>
</td>
</tr>
<tr class="windowbg">
<td align="right">', $txt['memberPermissions_state'], ':</td>
<td align="left">
<select name="state">
<option value="">', $txt['memberPermissions_select'], '</option>
<option value="1">', $txt['permissions_add'], '</option>
<option value="0">', $txt['permissions_deny'], '</option>
</select>
</td>
</tr>
<tr class="titlebg">
<td colspan="3"><input type="submit" name="add" value="', $txt['memberPermissions_add_but'], '"></td>
</tr>
</table>
</form>';



En el archivo ./Sources/Profile.php

Buscar:



$context['member']['permissions']['board'][$row['permission']]['is_denied'] |= empty($row['addDeny']);
}
mysql_free_result($request);


Añadir después:


$context['member']['specific_permissions'] = array();
$context['member']['specific_board_permissions'] = array();
$result = db_query("
SELECT mp.permission, mp.addDeny, mp.ID_BOARD, b.name AS boardName
FROM {$db_prefix}member_permissions AS mp
LEFT JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = mp.ID_BOARD)
WHERE mp.ID_MEMBER = $memID
ORDER BY mp.addDeny DESC, mp.ID_BOARD", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result))
{
// We don't know about this permission, it doesn't exist :P.
if (!isset($txt['permissionname_' . $row['permission']]))
continue;

if (in_array(substr($row['permission'], -4), array('_own', '_any')) && isset($txt['permissionname_' . substr($row['permission'], 0, -4)]))
$name = $txt['permissionname_' . substr($row['permission'], 0, -4)] . ' - ' . $txt['permissionname_' . $row['permission']];
else
$name = $txt['permissionname_' . $row['permission']];

if ($row['ID_BOARD'] == -1)
$context['member']['specific_member_permissions'][] = array(
'id' => $row['permission'],
'name' => $name,
'denied' => empty($row['addDeny'])
);
else
$context['member']['specific_board_permissions'][] = array(
'id' => $row['permission'],
'name' => $name,
'board_id' => $row['ID_BOARD'],
'board' => $row['ID_BOARD'] == 0 ? $txt['memberPermissions_all'] : $row['boardName'],
'denied' => empty($row['addDeny'])
);
}
mysql_free_result($result);
// Have to load ALL possible permissiond!
$generalPerms = array(
'search_posts',
'calendar_view',
'view_stats',
'who_view',
'profile_view_own',
'profile_identity_own',
'view_mlist',
'karma_edit',
'pm_read',
'pm_send',
'profile_view_any',
'profile_extra_own',
'profile_remote_avatar',
'calendar_post',
'calendar_edit_own',
'manage_attachments',
'manage_smileys',
'manage_boards',
'moderate_forum',
'manage_membergroups',
'manage_bans',
'admin_forum',
'manage_permissions',
'edit_news',
'calendar_edit_any',
'profile_identity_any',
'profile_extra_any',
'profile_title_any',
);
$boardPerms = array(
'poll_view',
'post_new',
'post_reply_any',
'remove_own',
'modify_own',
'mark_any_notify',
'mark_notify',
'report_any',
'send_topic',
'poll_vote',
'poll_edit_own',
'poll_post',
'poll_add_own',
'post_attachment',
'lock_own',
'delete_own',
'view_attachments',
'make_sticky',
'poll_edit_any',
'remove_any',
'modify_any',
'lock_any',
'delete_any',
'move_any',
'merge_any',
'split_any',
'poll_lock_any',
'poll_remove_any',
'poll_add_any',
);

$context['generalPerms'] = array();
$context['boardPerms'] = array();
foreach ($generalPerms as $id)
{
// If I mess up here... just don't put egg on my face
if (!isset($txt['permissionname_' . $id]))
continue;

if (in_array(substr($id, -4), array('_own', '_any')) && isset($txt['permissionname_' . substr($id, 0, -4)]))
$name = $txt['permissionname_' . substr($id, 0, -4)] . ' - ' . $txt['permissionname_' . $id];
else
$name = $txt['permissionname_' . $id];
$context['generalPerms'][$id] = $name;
}
foreach ($boardPerms as $id)
{
// If I mess up here... just don't put egg on my face
if (!isset($txt['permissionname_' . $id]))
continue;

if (in_array(substr($id, -4), array('_own', '_any')) && isset($txt['permissionname_' . substr($id, 0, -4)]))
$name = $txt['permissionname_' . substr($id, 0, -4)] . ' - ' . $txt['permissionname_' . $id];
else
$name = $txt['permissionname_' . $id];
$context['boardPerms'][$id] = $name;
}
asort($context['generalPerms']);
asort($context['boardPerms']);

// Get ALL boards here - not just local ones!
$result = db_query("
SELECT b.ID_BOARD, b.name
FROM {$db_prefix}boards AS b
WHERE $user_info[query_see_board]", __FILE__, __LINE__);
$context['mems_boards'] = array();
while ($row = mysql_fetch_assoc($result))
$context['mems_boards'][$row['ID_BOARD']] = array(
'id' => $row['ID_BOARD'],
'name' => $row['name'],
'selected' => $board == $row['ID_BOARD']
);
mysql_free_result($result);


Buscar:


function showPermissions($memID)
{
global $scripturl, $txt, $db_prefix, $board, $modSettings;
global $user_profile, $context, $user_info;


Añadir después:


// They want to delete stuff?
if (isset($_POST['conf_delete']))
{
if (isset($_POST['delete']))
foreach ($_POST['delete'] as $ID_BOARD => $permissions)
{
foreach ($permissions as $perm => $dummy)
db_query("
DELETE FROM {$db_prefix}member_permissions
WHERE ID_MEMBER = $memID
AND ID_BOARD = $ID_BOARD
AND permission = '$perm'", __FILE__, __LINE__);
}
}
// What if they want to add a new permission? How exciting!!
elseif (isset($_POST['add']) && $_POST['type'] != '' && $_POST['state'] != '')
{
$addDeny = (int) $_POST['state'];
$boardid = $_POST['type'] == 'board' ? (int) $_POST['board4p'] : -1;
$permission = $_POST['type'] == 'board' ? $_POST['bpermission'] : $_POST['gpermission'];
if ($permission != '')
db_query("
REPLACE INTO {$db_prefix}member_permissions
(ID_MEMBER, ID_BOARD, permission, addDeny)
VALUES
($memID, $boardid, '$permission', $addDeny)", __FILE__, __LINE__);
}
$context['member']['id'] = $memID;


En el archivo ./Sources/Subs-Members.php

Buscar:


db_query("
DELETE FROM {$db_prefix}themes
WHERE ID_MEMBER $condition", __FILE__, __LINE__);


Añadir después:


db_query("
DELETE FROM {$db_prefix}member_permissions
WHERE ID_MEMBER $condition", __FILE__, __LINE__);


En el archivo ./Themes/default/languages/Modifications.english.php

Buscar:


?>


Añadir antes:



$txt['permission_bymember'] = 'Permissions By Member';
$txt['permission_bymember_link'] = 'Click';
$txt['permission_bymember_link2'] = 'Here';
$txt['permission_bymember_link3'] = 'To Review Member Specific Permissions';
$txt['memberPermissions_general'] = 'Member Specific Permissions';
$txt['memberPermissions_board'] = 'Member Specific Board Permissions';
$txt['memberPermissions_none'] = 'This member has no member specific permissions';
$txt['memberPermissions_where'] = 'In Board';
$txt['memberPermissions_all'] = 'All Boards';
$txt['memberPermissions_add'] = 'Add New Member <b>Specific</b> Permission';
$txt['memberPermissions_type'] = 'Permission Type';
$txt['memberPermissions_general'] = 'General Permission';
$txt['memberPermissions_board'] = 'Board Permission';
$txt['memberPermissions_board_select'] = 'Select Board';
$txt['memberPermissions_permission'] = 'Select Permission';
$txt['memberPermissions_state'] = 'Permission State';
$txt['memberPermissions_select'] = 'Select:';
$txt['memberPermissions_add_but'] = 'Add';


En el archivo ./Themes/default/languages/Modifications.spanish_es.php

Buscar:


?>


Añadir antes:



$txt['permission_bymember'] = 'Permisos Por Miembro';
$txt['permission_bymember_link'] = 'Click';
$txt['permission_bymember_link2'] = 'Aqui';
$txt['permission_bymember_link3'] = 'Para revisar permisos especificos del miembro';
$txt['memberPermissions_general'] = 'Permisos especificos del miembro';
$txt['memberPermissions_board'] = 'Permisos especificos del miembro por foro';
$txt['memberPermissions_none'] = 'Este miembro no tiene permisos especificos';
$txt['memberPermissions_where'] = 'En el Foro';
$txt['memberPermissions_all'] = 'Todos los Foros';
$txt['memberPermissions_add'] = 'A&ntilde;adir nuevo Permiso <b>Especifico</b>';
$txt['memberPermissions_type'] = 'Tipo de permiso';
$txt['memberPermissions_general'] = 'Permiso general';
$txt['memberPermissions_board'] = 'Permisos por Foro';
$txt['memberPermissions_board_select'] = 'Seleccionar Foro';
$txt['memberPermissions_permission'] = 'Seleccionar Permiso';
$txt['memberPermissions_state'] = 'Estado del Permiso';
$txt['memberPermissions_select'] = 'Seleccionar:';
$txt['memberPermissions_add_but'] = 'A&ntilde;adir';



En el archivo ./Themes/default/ManagePermissions.template.php

Buscar:


if (!empty($context['board']))
echo '
<input type="hidden" name="boardid" value="', $context['board']['id'], '" />';


Añadir antes:


echo '
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tborder" style="margin-top: 2ex;">
<tr class="catbg">
<td style="padding: 4px;">', $txt['permission_bymember'], '</td>
</tr><tr class="windowbg" align="center">
<td style="padding: 4px;">', $txt['permission_bymember_link'], ' <a href="', $scripturl, '?action=permissions;sa=mspecific">', $txt['permission_bymember_link2'], '</a> ', $txt['permission_bymember_link3'], '</td>
</tr>
</table>';


Buscar:


function template_modify_group()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;


Añadir antes:


function template_member_specific()
{
global $context, $settings, $options, $scripturl, $txt;

$alternate = 0;
echo '
<table width="60%" border="0" cellspacing="0" cellpadding="1" class="bordercolor" align="center"><tr><td>
<table border="0" width="100%" cellspacing="0" cellpadding="4" class="bordercolor">
<tr class="catbg">
<td colspan="4" align="left">', $txt['permission_bymember'], '</td>
</tr>
<tr class="titlebg">
<td align="left">', $txt[68], '</td>
<td align="center" width="12%">', $txt['permissions_allowed'], '</td>
<td align="center" width="12%">', $txt['permissions_denied'], '</td>
<td></td>
</tr>';
foreach ($context['permissions'] as $member)
{
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
<td align="left">', $member['name'], '</td>
<td align="center">', $member['allow'], '</td>
<td align="center"><font color="red">', $member['deny'], '</font></td>
<td align="center">', $member['link'], '</td>
</tr>';
$alternate = !$alternate;
}

echo '
</table></td></tr>
</table>';
}



En el archivo ./Sources/ManagePermissions.php

Buscar:


'quick' => array('SetQuickGroups', 'manage_permissions'),


Añadir después:


'mspecific' => array('SpecificPermissions', 'manage_permissions'),


Buscar:


function ModifyPermissions()
{


Añadir antes:


// Function for displaying all members with specific permissions;
function SpecificPermissions()
{
global $context, $txt, $db_prefix, $scripturl;

$context['sub_template'] = 'member_specific';
$context['page_title'] = $txt['permission_bymember'];

$context['permissions'] = array();

// Get all the counts for allow permissions
$request = db_query("
SELECT COUNT(mp.permission) AS allow, mp.ID_MEMBER, mem.realName
FROM {$db_prefix}member_permissions AS mp
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = mp.ID_MEMBER)
WHERE mp.addDeny = 1
GROUP BY mp.ID_MEMBER", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
$context['permissions'][$row['ID_MEMBER']] = array(
'name' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . ';sa=showPermissions">' . $txt['permissions_modify'] . '</a>',
'deny' => 0,
'allow' => $row['allow']
);
mysql_free_result($request);

// Same again but for deny!
$request = db_query("
SELECT COUNT(mp.permission) AS deny, mp.ID_MEMBER, mem.realName
FROM {$db_prefix}member_permissions AS mp
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = mp.ID_MEMBER)
WHERE mp.addDeny = 0
GROUP BY mp.ID_MEMBER", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
if (!isset($context['permissions'][$row['ID_MEMBER']]))
$context['permissions'][$row['ID_MEMBER']] = array(
'name' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . ';sa=showPermissions">' . $txt['permissions_modify'] . '</a>',
'deny' => $row['deny'],
'allow' => 0
);
else
$context['permissions'][$row['ID_MEMBER']]['deny'] = $row['deny'];
}
mysql_free_result($request);

obExit();
}



En el archivo ./Sources/Subs-Boards.php

Buscar:


// Delete any extra events in the calendar.
db_query("
DELETE FROM {$db_prefix}calendar
WHERE ID_BOARD IN (" . implode(', ', $boards_to_remove) . ')', __FILE__, __LINE__);


Añadir después:


// Delete any member permissions for this
db_query("
DELETE FROM {$db_prefix}member_permissions
WHERE ID_BOARD IN (" . implode(', ', $boards_to_remove) . ')', __FILE__, __LINE__);


Buscar:


// Delete any permissions associated with these boards.
db_query("
DELETE FROM {$db_prefix}board_permissions
WHERE ID_BOARD IN (" . implode(', ', $boards_to_remove) . ')', __FILE__, __LINE__);


Añadir después:


// Delete any permissions associated with this board.
db_query("
DELETE FROM {$db_prefix}member_permissions
WHERE ID_BOARD IN (" . implode(', ', $boards_to_remove) . ')', __FILE__, __LINE__);



Y con esto ya habremos terminado ;).




Algo a tener en cuenta

Puede pasar que al momento de elegir los permisos, algunos de estos falten, segun los mods que tengamos instalados. Para agregarlos, primero nos fijamos en el archivo En el archivo ./Sources/Profile.php.

Buscamos:


// Have to load ALL possible permissiond!
$generalPerms = array(
'search_posts',
'calendar_view',
'view_stats',
'who_view',
'profile_view_own',
'profile_identity_own',
'view_mlist',
'karma_edit',
'pm_read',
'pm_send',
'profile_view_any',
'profile_extra_own',
'profile_remote_avatar',
'calendar_post',
'calendar_edit_own',
'manage_attachments',
'manage_smileys',
'manage_boards',
'moderate_forum',
'manage_membergroups',
'manage_bans',
'admin_forum',
'manage_permissions',
'edit_news',
'calendar_edit_any',
'profile_identity_any',
'profile_extra_any',
'profile_title_any',
);
$boardPerms = array(
'poll_view',
'post_new',
'post_reply_any',
'remove_own',
'modify_own',
'mark_any_notify',
'mark_notify',
'report_any',
'send_topic',
'poll_vote',
'poll_edit_own',
'poll_post',
'poll_add_own',
'post_attachment',
'lock_own',
'delete_own',
'view_attachments',
'make_sticky',
'poll_edit_any',
'remove_any',
'modify_any',
'lock_any',
'delete_any',
'move_any',
'merge_any',
'split_any',
'poll_lock_any',
'poll_remove_any',
'poll_add_any',
);


Alli tienen un listado de los permisos (Generales y por Foro), y en esa lista hay que añadir los permisos que faltan. Estos permisos pueden encontrarlos en el archivo ./Sources/ManagePermissions.php. Por ejemplo para añadir el permiso del Click derecho (teniendo el mod instalado previamente, por supuesto) tienen que agregar en el array de $generalPerms:


'right_click',


Así con todas los permisos que falten, solo fijense el valor en ./Sources/ManagePermissions.php y añadanlo a la lista ;)




Agradecimientos:


  • A Grudge por el mod.
  • A 130860 por la consulta.
  • A DrHouse por explicar cómo generar la consulta en PhpMyAdmin.
  • A Arantor por el tip del Profile.php, para añadir permisos faltantes.


Saludos! ;D

|Fran|



PLAYKONG.NET/FOROS

Herr_Inoddorell

Quote from: thejoker.emerson on April 05, 2010, 08:08:39 PM
o.o pero de que te sirve ese mod

Para asignar o denegar permisos por usuario, y no por grupo ;). Supongo que alguno le encontrará su utilidad, al igual que yo lo hice.

En fin, cualquier duda sientanse libres de preguntar.

Saludos :)


Blackdozer

Quote from: NIBOGO on April 06, 2010, 01:17:07 PM
o pueden subir el paquete del mod emulando la version vieja que maneja y listo :)

Obviamente ya se que es la via manual pero es tan complicada, tediosa, larga tan phpbb :P
Yo antes utilizaba phpbb y eso no es nada, hay muchos mods que tienes que ejecutar las tablas, subir los archivos, etc...
Y he estado instalando mods de 1 hora, con lo que no te quejes  ::)
Ademas, tienes que dar animos,  no derrunbarnos xD

Herr_Inoddorell

Quote from: NIBOGO on April 06, 2010, 01:17:07 PM
o pueden subir el paquete del mod emulando la version vieja que maneja y listo :)

Obviamente ya se que es la via manual pero es tan complicada, tediosa, larga tan phpbb :P

Jajaja esa ultima frase ;D. Y sí, es un mod viejo la verdad, pero bueno, si tiene utilidad, bienvenido sea.

Es util por la Consulta, ya que la que presenta el parser está desactualizada o al menos en desuso. Cuando intenté usarla como dije en el topic anterior que hice sobre este mod, me tiró error, en cambio con la que está en el post principal, andubo bien.

Además, la modificacion que ahi aparece en el archivo Subs-Boards.php en el parser figura para ManageBoards.php. El problema es que esas lineas ya no se encuentran en este ultimo archivo, sino que deben hacerse en Subs-Boards.php con algunas minimas modificaciones, como se indica en el post principal.

También está la traducción al español, lo que es otra ventaja ;).

Saludos!

mirahalo

movido a tutoriales, a más de uno le servirá, gracias Herr_Inoddorell

egael

Muy buen mod, es muy util, sep.
Aplicado y funcionando perfectamente  ;D 
...aunque he añadido los permisos del simple portal a la lista y no consigo que aparezcan  ???, pero bue, funciona
Muchas gracias!!

Herr_Inoddorell

Perdona la tardanza de mi respuesta

Los permisos para ver bloques y esas cosas? Supongo que no debe ser sencillo. La verdad no conozco bien Simple Portal, pero para eso me parece que habria que hacer un menu aparte para cosas del portal, y ahi ya no tengo ni idea de como hacerlo ;D xD. Igual voy a ver si puedo llegar a algo, cualquier cosa aviso.

Saludos y gracias por los comentarios! ;)

Advertisement: