diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-12 19:21:00 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-02-12 19:21:00 +0000 |
commit | 81f78690dbcb0bb90304fb5e2b7343866d371615 (patch) | |
tree | 13e813246688812d944a406a351ee6c57134b82c | |
parent | 3f323153b5f201dd7954c7f4ba6da53c98defcd0 (diff) | |
download | forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.gz forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.bz2 forums-81f78690dbcb0bb90304fb5e2b7343866d371615.tar.xz forums-81f78690dbcb0bb90304fb5e2b7343866d371615.zip |
my turn to break things... harharhar
- checking in permission settings and permission masks
- permission presets and documentation not finished yet
- added backtrace function to determine file/line for sql errors
- fixed marlist for orphan attachments/groups/logs/users
- able to change anonymous user settings/permissions now
- re-arranged admin permissions a bit (added some and removed some)
- setting forum permissions after creating/editing forum now selects every default group (copy permisson/dropdown to be added for adding forums)
- finished user permissions in users acp
note: the layout for permissions might change
devs: please empty the user_permissions in phpbb_users. Also, first change your auth_options table, remove all cache files and then re-set admin permissions. After having set the admin permissions you can update your modules table (else you will not see the permission tabs) - or empty the auth setting within the modules table to be able to see the permission modules (they rely on newly added permission options)
git-svn-id: file:///svn/phpbb/trunk@5553 89ea8834-ac86-4346-8a33-228a782c2dd0
46 files changed, 3237 insertions, 210 deletions
diff --git a/phpBB/adm/images/arrow_down.gif b/phpBB/adm/images/arrow_down.gif Binary files differnew file mode 100644 index 0000000000..e45c365ecc --- /dev/null +++ b/phpBB/adm/images/arrow_down.gif diff --git a/phpBB/adm/images/bg_hash1.gif b/phpBB/adm/images/bg_hash1.gif Binary files differnew file mode 100644 index 0000000000..61163679a8 --- /dev/null +++ b/phpBB/adm/images/bg_hash1.gif diff --git a/phpBB/adm/images/bg_hash2.gif b/phpBB/adm/images/bg_hash2.gif Binary files differnew file mode 100644 index 0000000000..d31840361c --- /dev/null +++ b/phpBB/adm/images/bg_hash2.gif diff --git a/phpBB/adm/images/bg_hash3.gif b/phpBB/adm/images/bg_hash3.gif Binary files differnew file mode 100644 index 0000000000..40bc7e1b5c --- /dev/null +++ b/phpBB/adm/images/bg_hash3.gif diff --git a/phpBB/adm/images/bg_hash4.gif b/phpBB/adm/images/bg_hash4.gif Binary files differnew file mode 100644 index 0000000000..54e7f0019f --- /dev/null +++ b/phpBB/adm/images/bg_hash4.gif diff --git a/phpBB/adm/images/gradient2b.gif b/phpBB/adm/images/gradient2b.gif Binary files differnew file mode 100644 index 0000000000..a8107659e2 --- /dev/null +++ b/phpBB/adm/images/gradient2b.gif diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index a08a0f3d85..4d309e9b76 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -361,24 +361,6 @@ <!-- ELSEIF S_ORPHAN --> - <script type="text/javascript"> - <!-- - function marklist(match, name, status) - { - var object = document.getElementById(match); - - var len = object.length; - - for (i = 0; i < len; i++) - { - result = eval('object.elements[' + i + '].name.search(/' + name + '.+/)'); - if (result != -1) - object.elements[i].checked = status; - } - } - //--> - </script> - <form id="orphan" method="post" action="{U_ACTION}"> <table cellspacing="1"> @@ -403,8 +385,8 @@ <!-- END orphan --> <tr> <td colspan="3"> </td> - <td class="small"><a href="javascript:marklist('attachments', 'add', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('attachments', 'add', false);">{L_UNMARK_ALL}</a></td> - <td class="small"><a href="javascript:marklist('attachments', 'delete', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('attachments', 'delete', false);">{L_UNMARK_ALL}</a></td> + <td class="small"><a href="javascript:marklist('orphan', 'add', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'add', false);">{L_UNMARK_ALL}</a></td> + <td class="small"><a href="javascript:marklist('orphan', 'delete', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('orphan', 'delete', false);">{L_UNMARK_ALL}</a></td> </tr> </tbody> </table> diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index c083d930a3..125f39d70d 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -210,7 +210,7 @@ </div> <fieldset class="quick"> - <span class="small"><a href="javascript:marklist('list', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', false);">{L_UNMARK_ALL}</a></span><br /> + <span class="small"><a href="javascript:marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="javascript:marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></span><br /> <select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> <input class="button2" type="submit" name="update" value="{L_SUBMIT}" /> diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html index 5d3e49a6a7..4603561d28 100644 --- a/phpBB/adm/style/acp_logs.html +++ b/phpBB/adm/style/acp_logs.html @@ -62,7 +62,7 @@ <!-- IF S_CLEARLOGS --> <fieldset class="quick"> - <b class="small"><a href="#" onclick="marklist('list', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', false);">{L_UNMARK_ALL}</a></b><br /> + <b class="small"><a href="#" onclick="marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></b><br /> <input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" /> <input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" /> </fieldset> diff --git a/phpBB/adm/style/acp_main.html b/phpBB/adm/style/acp_main.html index 4b754c3c74..1b521e1ec9 100644 --- a/phpBB/adm/style/acp_main.html +++ b/phpBB/adm/style/acp_main.html @@ -1,17 +1,5 @@ <!-- INCLUDE overall_header.html --> -<script type="text/javascript"> -<!-- - function marklist(status) - { - for (i = 0; i < document.inactive.length; i++) - { - document.inactive.elements[i].checked = status; - } - } -//--> -</script> - <a name="maincontent"></a><h1>{L_WELCOME_PHPBB}</h1> <p>{L_ADMIN_INTRO}</p> @@ -140,7 +128,7 @@ <!-- IF .inactive --> <fieldset class="quick"> - <p><a href="javascript:marklist(true);">Mark all</a> • <a href="javascript:marklist(false);">Unmark all</a></p> + <p><a href="javascript:marklist('inactive', 'mark', true);">{L_MARK_ALL}</a> • <a href="javascript:marklist('inactive', 'mark', false);">{L_UNMARK_ALL}</a></p> <select name="action">{S_INACTIVE_OPTIONS}</select> <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" /> diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html new file mode 100644 index 0000000000..a3fe26426f --- /dev/null +++ b/phpBB/adm/style/acp_permissions.html @@ -0,0 +1,318 @@ +<!-- INCLUDE overall_header.html --> + +<a name="maincontent"></a> + +<!-- IF S_SELECT_VICTIM --> + + <h1>{L_TITLE}</h1> + + <p>{L_EXPLAIN}</p> + + <!-- IF S_FORUM_NAMES --> + <p><b>{L_FORUMS}:</b> {FORUM_NAMES}</p> + <!-- ENDIF --> + + <!-- IF S_SELECT_FORUM --> + + <form id="select_victim" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_LOOK_UP_FORUM}</legend> + <!-- IF S_FORUM_MULTIPLE --><p>{L_LOOK_UP_FORUMS_EXPLAIN}</p><!-- ENDIF --> + <dl> + <dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt> + <dd><select id="forum" name="forum_id[]"<!-- IF S_FORUM_MULTIPLE --> multiple="multiple"<!-- ENDIF --> size="10">{S_FORUM_OPTIONS}</select></dd> + <!-- IF S_FORUM_ALL --><dd><input type="checkbox" name="all_forums" value="1" /> {L_ALL_FORUMS}</dd><!-- ENDIF --> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" /> + </fieldset> + + </form> + + <!-- ELSEIF S_SELECT_USER and S_CAN_SELECT_USER --> + + <form id="select_victim" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_LOOK_UP_USER}</legend> + <dl> + <dt><label for="username">{L_FIND_USERNAME}:</label></dt> + <dd><input class="medium" type="text" id="username" name="username[]" /></dd> + <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd class="full" style="text-align: left;"><input type="checkbox" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" /> + </fieldset> + + </form> + + <!-- ELSEIF S_SELECT_GROUP and S_CAN_SELECT_GROUP --> + + <form id="select_victim" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_LOOK_UP_GROUP}</legend> + <dl> + <dt><label for="group">{L_LOOK_UP_GROUP}:</label></dt> + <dd><select name="group_id[]" id="group">{S_GROUP_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" /> + </fieldset> + + </form> + + <!-- ELSEIF S_SELECT_USERGROUP --> + + <div style="float: left; width: 48%;"> + + <!-- IF S_CAN_SELECT_USER --> + + <h1>{L_USERS}</h1> + + <form id="users" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_MANAGE_USERS}</legend> + <dl> + <dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input class="button2" type="submit" name="action[delete]" value="{L_DELETE}" /> + <input class="button1" type="submit" name="submit_edit_options" value="{L_SET_PERMISSIONS}" /> + </fieldset> + + </form> + + <form id="add_user" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_ADD_USERS}</legend> + <p>{L_USERNAMES_EXPLAIN}</p> + <dl> + <dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd> + <dd class="full" style="text-align: left;"><input type="checkbox" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input class="button2" type="submit" name="find_username" value="{L_FIND_USERNAME}" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;" /> + <input class="button1" type="submit" name="submit_add_options" value="{L_SET_PERMISSIONS}" /> + </fieldset> + + </form> + + <!-- ENDIF --> + + </div> + + <div style="float: right; width: 48%"> + + <!-- IF S_CAN_SELECT_GROUP --> + + <h1>{L_USERGROUPS}</h1> + + <form id="groups" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_MANAGE_GROUPS}</legend> + <dl> + <dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input class="button2" type="submit" name="action[delete]" value="{L_DELETE}" /> + <input class="button1" type="submit" name="submit_edit_options" value="{L_SET_PERMISSIONS}" /> + </fieldset> + + </form> + + <form id="add_groups" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_ADD_GROUPS}</legend> + <dl> + <dd class="full"><select name="group_id[]" style="width: 100%; height: 107px;" multiple="multiple">{S_ADD_GROUP_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" class="button1" name="submit_add_options" value="{L_SET_PERMISSIONS}" /> + </fieldset> + + </form> + + <!-- ENDIF --> + + </div> + + <!-- ELSEIF S_SELECT_USERGROUP_VIEW --> + + <div style="float: left; width: 48%;"> + + <h1>{L_USERS}</h1> + + <form id="users" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_MANAGE_USERS}</legend> + <dl> + <dd class="full"><select style="width: 100%;" name="user_id[]" multiple="multiple" size="5">{S_DEFINED_USER_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input class="button1" type="submit" name="submit" value="{L_VIEW_PERMISSIONS}" /> + </fieldset> + + </form> + + <form id="add_user" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_LOOK_UP_USER}</legend> + <dl> + <dt><label for="username">{L_FIND_USERNAME}:</label></dt> + <dd><input type="text" id="username" name="username[]" /></dd> + <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> + <dd class="full" style="text-align: left;"><input type="checkbox" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" name="submit" value="{L_VIEW_PERMISSIONS}" class="button1" /> + </fieldset> + + </form> + + </div> + + <div style="float: right; width: 48%"> + + <h1>{L_USERGROUPS}</h1> + + <form id="groups" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_MANAGE_GROUPS}</legend> + <dl> + <dd class="full"><select style="width: 100%;" name="group_id[]" multiple="multiple" size="5">{S_DEFINED_GROUP_OPTIONS}</select></dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input class="button1" type="submit" name="submit" value="{L_VIEW_PERMISSIONS}" /> + </fieldset> + + </form> + + <form id="group" method="post" action="{U_ACTION}"> + + <fieldset> + <legend>{L_LOOK_UP_GROUP}</legend> + <dl> + <dt><label for="group">{L_LOOK_UP_GROUP}:</label></dt> + <dd><select name="group_id[]" id="group">{S_ADD_GROUP_OPTIONS}</select></dd> + <dd> </dd> + </dl> + </fieldset> + + <fieldset class="quick"> + {S_HIDDEN_FIELDS} + <input type="submit" name="submit" value="{L_VIEW_PERMISSIONS}" class="button1" /> + </fieldset> + + </form> + + </div> + + <!-- ENDIF --> + +<!-- ENDIF --> + +<!-- IF S_VIEWING_PERMISSIONS --> + + <h1>{L_ACL_VIEW}</h1> + + <p>{L_ACL_VIEW_EXPLAIN}</p> + + <fieldset class="quick"> + <b>» {L_PERMISSION_TYPE}</b> + </fieldset> + + <!-- INCLUDE permission_mask.html --> + +<!-- ENDIF --> + +<!-- IF S_SETTING_PERMISSIONS --> + + <h1>{L_ACL_SET}</h1> + + <p>{L_ACL_SET_EXPLAIN}</p> + + <br /> + + <fieldset class="quick" style="float: right;"> + <b>» {L_PERMISSION_TYPE}</b> + </fieldset> + + <!-- IF S_PERMISSION_DROPDOWN --> + <form id="pselect" method="post" action="{U_ACTION}"> + + <fieldset class="quick" style="float: left;"> + {S_HIDDEN_FIELDS} + {L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select> + + <input class="button2" type="submit" name="submit" value="{L_GO}" /> + </fieldset> + + </form> + <!-- ENDIF --> + + <br /><br /> + + <form id="set_permissions" method="post" action="{U_ACTION}"> + + {S_HIDDEN_FIELDS} + + <!-- INCLUDE permission_mask.html --> + + <br /><br /> + + <fieldset class="quick" style="float: left;"> + {L_PERM_PRESET_APPLIED_TO_ALL}<br /> + <a href="javascript:marklist('set_permissions', 'inherit', true);">{L_MARK_ALL}</a> • <a href="javascript:marklist('set_permissions', 'inherit', false);">{L_UNMARK_ALL}</a> + </fieldset> + + <fieldset class="quick" style="float: right;"> + <input class="button1" type="submit" name="action[apply_all_permissions]" value="{L_APPLY_ALL_PERMISSIONS}" /> + </fieldset> + + <br /><br /> + + </form> + +<!-- ENDIF --> + +<!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 0ecfc49417..35ceefe171 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -16,7 +16,7 @@ <dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dd><input class="medium" type="text" id="username" name="username" /></dd> <dd>[ <a href="#" onclick="window.open('{U_FIND_USERNAME}', '_phpbbsearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> - <dd class="full" style="text-align: left;"><input type="checkbox" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> Select Anonymous User</dd> + <dd class="full" style="text-align: left;"><input type="checkbox" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> {L_SELECT_ANONYMOUS}</dd> </dl> </fieldset> @@ -203,7 +203,7 @@ <!-- IF S_CLEARLOGS --> <fieldset class="quick"> - <b class="small"><a href="#" onclick="marklist('list', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', false);">{L_UNMARK_ALL}</a></b><br /> + <b class="small"><a href="#" onclick="marklist('list', 'mark', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('list', 'mark', false);">{L_UNMARK_ALL}</a></b><br /> <input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" /> <input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" /> </fieldset> @@ -696,12 +696,21 @@ <!-- ENDIF --> <fieldset class="quick"> - <b class="small"><a href="#" onclick="marklist('user_attachments', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('user_attachments', false);">{L_UNMARK_ALL}</a></b><br /> + <b class="small"><a href="#" onclick="marklist('user_attachments', 'mark', true);">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('user_attachments', 'mark', false);">{L_UNMARK_ALL}</a></b><br /> <input class="button2" type="submit" name="delmarked" value="{L_DELETE_MARKED}" /> </fieldset> </form> +<!-- ELSEIF S_PERMISSIONS --> + + <fieldset class="quick"> + <a href="{U_USER_PERMISSIONS}">» {L_SET_USERS_PERMISSIONS}</a><br /> + <a href="{U_USER_FORUM_PERMISSIONS}">» {L_SET_USERS_FORUM_PERMISSIONS}</a> + </fieldset> + + <!-- INCLUDE permission_mask.html --> + <!-- ENDIF --> <!-- INCLUDE overall_footer.html -->
\ No newline at end of file diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index aa0cb68871..dd71698c93 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -281,6 +281,7 @@ td { .row1 { background-color: #EFEFEF; } .row2 { background-color: #DEE3E7; } .row3 { background-color: #D1D7DC; } +.row4 { background-color: #E4E8EB; } .col1 { background-color: #DEE3E7; } .col2 { background-color: #EFEFEF; } @@ -648,6 +649,168 @@ a.button2, a.button2:link, a.button2:visited, a.button2:active { padding: 4px 8px; } +/* Permission related +---------------------------------------- */ + +.permissions { + margin: 15px 0 0 0; + padding: 0; + border: none; + background-color: transparent; +} + +.permissions table { + width: 100%; + /*empty-cells: hide;*/ + border: 1px solid #CCCFD3; + background-color: #FFFFFF; + padding: 1px; +} + +.permissions th { + padding: 3px 4px; + color: #FFFFFF; + background: #DDE1E4 url("../images/gradient2b.gif") bottom left repeat-x; + border-top: 1px solid #6DACD2; + border-bottom: 1px solid #327AA5; + text-align: left; + font-size: .85em; + text-transform: uppercase; +} + +.permissions td { + text-align: left; + font-size: 1.1em; + padding: 4px; + line-height: 120%; +} + +table.pmask { + border: none; + background: none; + padding: 0; +} + +table.pmask th { + background: none; + border-top: none; + text-align: center; + vertical-align: bottom; + color: #115098; + padding: 2px 0; +} + +table.pmask td { + padding: 0px; +} + +table.pmask td.name { + padding: 2px; + vertical-align: middle; +} + +.permissions th.name { + text-align: left; + width: auto; + padding-left: 4px; +} + +.permissions .entry { + text-align: left; + font-weight: normal; +} + +.permissions td.name { + text-align: left; + font-weight: bold; +} + +.permissions table.type3 { + float: right; + width: 350px; /* Setting the length of the permission view box */ + border: none; + background-color: transparent; + padding: 0; +} + +.permissions table.type3 thead th { + background-color: transparent; + border-top: none; + text-align: center; + color: #115098; + padding: 0 3px; + font-size: .9em; + font-weight: normal; + text-transform: none; +} + +.permissions table.type3 tbody th { + border-top: none; + text-align: left; + text-transform: none; + padding: 0; + border: none; + font-size: 1em; + font-weight: normal; + width: 100%; + vertical-align: middle; +} + +.permissions table.type3 td { + text-align: center; + padding: 1px; +} + +.permissions td.yes { + width: 20px; + background-color: #40C53D; +} + +.permissions td.no { + width: 20px; + background-color: #EC7181; +} + +.permissions td.unset { + width: 20px; + background-color: transparent; +} + +/* Preset Styles +---------------------------------------- */ +.preset_yes, .preset_custom, .preset_no, .preset_unset { + width: 60px; +} + +.preset_yes a span, .preset_custom a span, .preset_no a span, .preset_unset a span { + float: left; + display: block; + width: 100%; + height: 20px; + cursor: pointer; + background: none; +} + +.preset_yes a:hover span, .preset_custom a:hover span, .preset_no a:hover span, .preset_unset a:hover span { + background: url("../images/arrow_down.gif") no-repeat 50% 50%; + text-decoration: none; +} + +.preset_yes { + background: #D3F3D2 url("../images/bg_hash1.gif") repeat; +} + +.preset_custom { + background: #DAE4EC url("../images/bg_hash2.gif") repeat; +} + +.preset_no { + background: #ECD7DA url("../images/bg_hash3.gif") repeat; +} + +.preset_unset { + background: #ECD7DA url("../images/bg_hash4.gif") repeat; +} /* Action Highlighting ---------------------------------------- */ diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index 0cfc50bbdd..9345ae0682 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -45,12 +45,24 @@ function dE(n, s, type) e.style.display = (s == 1) ? type : 'none'; } -function marklist(match, status) +// Mark/unmark checkboxes +// id = ID of parent container, name = name prefix, state = state [true/false] +function marklist(id, name, state) { - doc = document.getElementById(match); - for (i = 0; i < doc.length; i++) + var parent = document.getElementById(id); + if (!parent) { - doc.elements[i].checked = status; + return; + } + + var rb = parent.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) + { + if (rb[r].name.substr(0, name.length) == name) + { + rb[r].checked = state; + } } } diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html new file mode 100644 index 0000000000..263ff3fffa --- /dev/null +++ b/phpBB/adm/style/permission_mask.html @@ -0,0 +1,179 @@ + +<script type="text/javascript"> +<!-- + var active_pmask = '0'; + var active_fmask = '0'; + var active_cat = '0'; + + // Show/hide option panels + // value = suffix for ID to show + function swap_options(pmask, fmask, cat) + { + id = pmask + fmask + cat; + active_option = active_pmask + active_fmask + active_cat; + + if (id == active_option) + { + return; + } + + // Hide active options + dE('options' + active_option, -1); + dE('head' + active_pmask + active_fmask, 1, 'inline'); + dE('apply' + active_pmask + active_fmask, -1); + + // Display container + dE('options' + id, 1); + dE('head' + pmask + fmask, -1, 'inline'); + dE('apply' + pmask + fmask, 1); + + active_pmask = pmask; + active_fmask = fmask; + active_cat = cat; + } + + // Mark all radio buttons in one panel + // id = table ID container, s = status [1/-1/0] + function mark_options(id, s) + { + var t = document.getElementById(id); + + if (!t) + { + return; + } + + var rb = t.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++ ) + { + if (rb[r].id.substr(rb[r].id.length-1) == s) + { + rb[r].checked = true; + } + } + } + +//--> +</script> + +<!-- BEGIN p_mask --> + +<fieldset class="permissions"> + <!-- IF p_mask.USER_GROUPS_DEFAULT or p_mask.USER_GROUPS_CUSTOM --> + <br /> + <p> + <!-- IF p_mask.USER_GROUPS_DEFAULT --><b>{p_mask.NAME}</b> {L_USER_IS_MEMBER_OF_DEFAULT}: <b>{p_mask.USER_GROUPS_DEFAULT}</b><br /><!-- ENDIF --> + <!-- IF p_mask.USER_GROUPS_CUSTOM --><b>{p_mask.NAME}</b> {L_USER_IS_MEMBER_OF_CUSTOM}: <b>{p_mask.USER_GROUPS_CUSTOM}</b><!-- ENDIF --> + </p> + <!-- ENDIF --> + + <table cellspacing="1" class="pmask"> + <thead> + <tr> + <th style="text-align: left; width: 70%">{p_mask.NAME}<!-- IF p_mask.S_LOCAL --><span class="small" style="text-transform: none;"> [{p_mask.L_ACL_TYPE}]</span><!-- ENDIF --></th> + <th>{p_mask.CATEGORIES}</th> + </tr> + </thead> + <tbody> + + <!-- BEGIN f_mask --> + <!-- IF p_mask.f_mask.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> + <td class="name"> + <table cellspacing="0" cellpadding="0" class="type2" style="background-color: transparent; border: 0;"> + <tbody> + <tr> + <td width="16"> + <span id="head{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}"<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW --> style="display: none;"<!-- ENDIF -->> + <!-- IF not p_mask.S_VIEW --><input type="checkbox" name="inherit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="1" /><!-- ELSE --> <!-- ENDIF --> + </span> + </td> + <td>{p_mask.f_mask.PADDING}<a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '0');">{p_mask.f_mask.NAME}</a></span></td> + <td style="text-align: right;"> + <!-- IF p_mask.S_VIEW --> + + <!-- ELSE --> + <!-- <b>{L_PRESET}:</b> <select name="preset[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]"> + <option value="">Select preset...</option> + <option value="2">Valued Members</option> + <option value="3">Restricted Access</option> + </select> --> + <!-- ENDIF --> + </td> + </tr> + </tbody> + </table> + </td> + <!-- BEGIN category --> + <!-- IF p_mask.f_mask.category.S_YES --> + <td class="preset_yes"> + <!-- ELSEIF p_mask.f_mask.category.S_NO --> + <td class="preset_no"> + <!-- ELSEIF p_mask.f_mask.category.S_UNSET --> + <td class="preset_unset"> + <!-- ELSE --> + <td class="preset_custom"> + <!-- ENDIF --> + <a href="javascript:swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}');"><span> </span></a></td> + <!-- END category --> + </tr> + <tr class="row3"> + <td style="vertical-align: top;"> + <div id="apply{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" style="text-align: left; width: 98%; margin: 5px;<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW --><!-- ELSE --> display: none;<!-- ENDIF -->"> + <!-- IF not p_mask.S_VIEW --> + <div style="float: left; width: 60%;"> + <p class="small">{L_APPLY_PERMISSIONS_EXPLAIN}</p> + <input class="button1" type="submit" name="psubmit[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" value="{L_APPLY_PERMISSIONS}" /> + </div> + <div style="float: right; text-align: right; width: 35%;"> + <p class="small"><a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'y')">{L_ALL_YES}</a> • <a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'n')">{L_ALL_NO}</a> • <a href="javascript: mark_options('a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}', 'u')">{L_ALL_UNSET}</a></p> + </div> + <!-- ELSE --> + + <!-- ENDIF --> + </div> + </td> + <td colspan="{p_mask.S_NUM_CATS}" id="a_options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" style="vertical-align: top; text-align: left;"> + <div style="width: 350px; height: 0; line-height: 0;"> </div> + <!-- BEGIN category --> + <table cellspacing="1" id="options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}" class="type3"<!-- IF p_mask.S_FIRST_ROW and p_mask.f_mask.S_FIRST_ROW and p_mask.f_mask.category.S_FIRST_ROW --><!-- ELSE --> style="display: none;"<!-- ENDIF -->> + <thead> + <tr> + <th scope="col" style="text-align: left; padding-left: 0;"><strong>{L_ACL_SETTING} [{p_mask.f_mask.category.CAT_NAME}]</strong></th> + <!-- IF p_mask.S_VIEW --> + <th scope="col">{L_ACL_YES}</th> + <th scope="col">{L_ACL_NO}</th> + <!-- ELSE --> + <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'y')">{L_ACL_YES}</a></th> + <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'u')">{L_ACL_UNSET}</a></th> + <th scope="col"><a href="javascript: mark_options('options{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}{p_mask.f_mask.category.S_ROW_COUNT}', 'n')">{L_ACL_NO}</a></th> + <!-- ENDIF --> + </tr> + </thead> + <tbody> + <!-- BEGIN mask --> + <!-- IF p_mask.f_mask.category.mask.S_ROW_COUNT is even --><tr class="row4"><!-- ELSE --><tr class="row3"><!-- ENDIF --> + <th>{p_mask.f_mask.category.mask.PERMISSION}</th> + <!-- IF p_mask.S_VIEW --> + <td<!-- IF p_mask.f_mask.category.mask.S_YES --> class="yes"<!-- ELSE --> class="unset"<!-- ENDIF -->> </td> + <td<!-- IF p_mask.f_mask.category.mask.S_NO --> class="no"<!-- ELSE --> class="unset"<!-- ENDIF -->> </td> + <!-- ELSE --> + <td class="unset"><input id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_y" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" type="radio"<!-- IF p_mask.f_mask.category.mask.S_YES --> checked="checked"<!-- ENDIF --> value="1" /></td> + <td class="unset"><input id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_u" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" type="radio"<!-- IF p_mask.f_mask.category.mask.S_UNSET --> checked="checked"<!-- ENDIF --> value="-1" /></td> + <td class="unset"><input id="{p_mask.f_mask.category.mask.S_FIELD_NAME}_n" name="{p_mask.f_mask.category.mask.S_FIELD_NAME}" type="radio"<!-- IF p_mask.f_mask.category.mask.S_NO --> checked="checked"<!-- ENDIF --> value="0" /></td> + <!-- ENDIF --> + </tr> + <!-- END mask --> + </tbody> + </table> + <!-- END category --> + </td> + </tr> + <!-- END f_mask --> + + </tbody> + </table> + +</fieldset> + +<!-- END p_mask --> diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 4aab5fe973..3a21c3bdab 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -30,19 +30,39 @@ function jumpto() // Set display of page element // s[-1,0,1] = hide,toggle display,show -function dE(n,s) +function dE(n, s, type) { + if (!type) + { + type = 'block'; + } + var e = document.getElementById(n); - if(!s) s = (e.style.display=='') ? -1:1; - e.style.display = (s==1) ? 'block':'none'; + if (!s) + { + s = (e.style.display == '') ? -1 : 1; + } + e.style.display = (s == 1) ? type : 'none'; } -function marklist(match, status) +// Mark/unmark checkboxes +// id = ID of parent container, name = name prefix, state = state [true/false] +function marklist(id, name, state) { - doc = document.getElementById(match); - for (i = 0; i < doc.length; i++) + var parent = document.getElementById(id); + if (!parent) + { + return; + } + + var rb = parent.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) { - doc.elements[i].checked = status; + if (rb[r].name.substr(0, name.length) == name) + { + rb[r].checked = state; + } } } diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 2fea1d866d..8ddc5016b2 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -337,7 +337,7 @@ class acp_bots_info 'title' => 'ACP_BOTS', 'version' => '1.0.0', 'modes' => array( - 'bots' => array('title' => 'ACP_BOTS', 'auth' => 'acl_a_server'), + 'bots' => array('title' => 'ACP_BOTS', 'auth' => 'acl_a_bots'), ), ); } diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index fc0aefa4a6..1a28cd905c 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -149,9 +149,23 @@ class acp_forums $auth->acl_clear_prefetch(); recalc_btree('forum_id', FORUMS_TABLE); + $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; + + // Add default groups to selection + $sql = 'SELECT group_id + FROM ' . GROUPS_TABLE . ' + WHERE group_type = ' . GROUP_SPECIAL; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $acl_url .= '&group_id[]=' . $row['group_id']; + } + $db->sql_freeresult($result); + // Redirect to permissions $message = ($action == 'add') ? $user->lang['FORUM_CREATED'] : $user->lang['FORUM_UPDATED']; - $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=permissions&mode=forum&submit_usergroups=true&ug_type=forum&action=usergroups&f[forum][]={$forum_data['forum_id']}" . '">', '</a>'); + $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . $phpbb_admin_path . "index.$phpEx$SID&i=permissions" . $acl_url . '">', '</a>'); trigger_error($message . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id)); } diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index e11543ba78..cfd1cb6c9b 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -10,6 +10,7 @@ /** * @package acp +* @todo make sure permissions are met for adding groups and removing groups (a_groupadd, a_groupdel) */ class acp_groups { diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index 56d460f176..58e88f5020 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -176,7 +176,7 @@ class acp_jabber_info 'title' => 'ACP_JABBER_SETTINGS', 'version' => '1.0.0', 'modes' => array( - 'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_server'), + 'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_jabber'), ), ); } diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 7bf8563440..414c313b21 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -1080,7 +1080,7 @@ class acp_language_info 'title' => 'ACP_LANGUAGE', 'version' => '1.0.0', 'modes' => array( - 'lang_packs' => array('title' => 'ACP_LANGUAGE_PACKS', 'auth' => 'acl_a_server'), + 'lang_packs' => array('title' => 'ACP_LANGUAGE_PACKS', 'auth' => 'acl_a_language'), ), ); } diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 8ac93203da..0bf02970d0 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -151,9 +151,9 @@ class acp_logs_info 'title' => 'ACP_LOGGING', 'version' => '1.0.0', 'modes' => array( - 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_'), - 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_'), - 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_'), + 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs'), + 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs'), + 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs'), ), ); } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 924ae6713b..3631272e75 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -57,6 +57,11 @@ class acp_main } else if ($action == 'delete') { + if (!$auth->acl_get('a_userdel')) + { + trigger_error($user->lang['NO_ADMIN']); + } + $sql = 'DELETE FROM ' . USER_GROUP_TABLE . " WHERE user_id IN ($mark)"; $db->sql_query($sql); $sql = 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)"; @@ -335,18 +340,23 @@ class acp_main ) ); - view_log('admin', $log_data, $log_count, 5); + $log_data = array(); - foreach ($log_data as $row) + if ($auth->acl_get('a_viewlogs')) { - $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], - 'IP' => $row['ip'], - 'DATE' => $user->format_date($row['time']), - 'ACTION' => $row['action']) - ); + view_log('admin', $log_data, $log_count, 5); + + foreach ($log_data as $row) + { + $template->assign_block_vars('log', array( + 'USERNAME' => $row['username'], + 'IP' => $row['ip'], + 'DATE' => $user->format_date($row['time']), + 'ACTION' => $row['action']) + ); + } } - + if ($auth->acl_get('a_user')) { $sql = 'SELECT user_id, username, user_regdate diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php new file mode 100644 index 0000000000..103c226611 --- /dev/null +++ b/phpBB/includes/acp/acp_permissions.php @@ -0,0 +1,739 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package acp +*/ +class acp_permissions +{ + var $u_action; + var $permission_dropdown; + + function main($id, $mode) + { + global $db, $user, $auth, $template, $cache; + global $config, $SID, $phpbb_root_path, $phpbb_admin_path, $phpEx; + + include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $auth_admin = new auth_admin(); + + $user->add_lang('acp/permissions'); + $user->add_lang('acp/permissions_phpbb'); + + $this->tpl_name = 'acp_permissions'; + $this->u_action = "{$phpbb_admin_path}index.$phpEx$SID&i=$id&mode=$mode"; + + // Set some vars + $action = request_var('action', array('' => 0)); + list($action, ) = each($action); + + $action = (isset($_POST['psubmit'])) ? 'apply_permissions' : $action; + + $all_forums = request_var('all_forums', 0); + $user_id = request_var('user_id', array(0)); + $group_id = request_var('group_id', array(0)); + $forum_id = request_var('forum_id', array(0)); + $username = request_var('username', array('')); + $usernames = request_var('usernames', ''); + + // Map usernames to ids and vice versa + if ($usernames) + { + $username = explode("\n", $usernames); + } + unset($usernames); + + if (sizeof($username) && !sizeof($user_id)) + { + user_get_id_name($user_id, $username); + + if (!sizeof($user_id)) + { + trigger_error($user->lang['SELECTED_USER_NOT_EXIST'] . adm_back_link($this->u_action)); + } + } + unset($username); + + // Define some common variables for every mode + $error = array(); + + $permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local'; + + switch ($mode) + { + case 'setting_user_global': + case 'setting_group_global': + $this->permission_dropdown = array('u_', 'm_', 'a_'); + $permission_victim = ($mode == 'setting_user_global') ? array('user') : array('group'); + $this->page_title = ($mode == 'setting_user_global') ? 'ACP_USERS_PERMISSIONS' : 'ACP_GROUPS_PERMISSIONS'; + break; + + case 'setting_user_local': + case 'setting_group_local': + $this->permission_dropdown = array('f_', 'm_'); + $permission_victim = ($mode == 'setting_user_local') ? array('user', 'forums') : array('group', 'forums'); + $this->page_title = ($mode == 'setting_user_local') ? 'ACP_USERS_FORUM_PERMISSIONS' : 'ACP_GROUPS_FORUM_PERMISSIONS'; + break; + + case 'setting_admin_global': + case 'setting_mod_global': + $this->permission_dropdown = (strpos($mode, '_admin_') !== false) ? array('a_') : array('m_'); + $permission_victim = array('usergroup'); + $this->page_title = ($mode == 'setting_admin_global') ? 'ACP_ADMINISTRATORS' : 'ACP_GLOBAL_MODERATORS'; + break; + + case 'setting_mod_local': + case 'setting_forum_local': + $this->permission_dropdown = ($mode == 'setting_mod_local') ? array('m_') : array('f_'); + $permission_victim = array('forums', 'usergroup'); + $this->page_title = ($mode == 'setting_mod_local') ? 'ACP_FORUM_MODERATORS' : 'ACP_FORUM_PERMISSIONS'; + break; + + case 'view_admin_global': + case 'view_user_global': + case 'view_mod_global': + $this->permission_dropdown = ($mode == 'view_admin_global') ? array('a_') : (($mode == 'view_user_global') ? array('u_') : array('m_')); + $permission_victim = array('usergroup_view'); + $this->page_title = ($mode == 'view_admin_global') ? 'ACP_VIEW_ADMIN_PERMISSIONS' : (($mode == 'view_user_global') ? 'ACP_VIEW_USER_PERMISSIONS' : 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS'); + break; + + case 'view_mod_local': + case 'view_forum_local': + $this->permission_dropdown = ($mode == 'view_mod_local') ? array('m_') : array('f_'); + $permission_victim = array('forums', 'usergroup_view'); + $this->page_title = ($mode == 'view_mod_local') ? 'ACP_VIEW_FORUM_MOD_PERMISSIONS' : 'ACP_VIEW_FORUM_PERMISSIONS'; + break; + + default: + trigger_error('INVALID_MODE'); + } + + $template->assign_vars(array( + 'L_TITLE' => $user->lang[$this->page_title], + 'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN']) + ); + + // Get permission type + $permission_type = request_var('type', $this->permission_dropdown[0]); + + if (!in_array($permission_type, $this->permission_dropdown)) + { + trigger_error($user->lang['WRONG_PERMISSION_TYPE'] . adm_back_link($this->u_action)); + } + + + // Handle actions + if (strpos($mode, 'setting_') === 0 && $action) + { + switch ($action) + { + case 'delete': + $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id); + break; + + case 'apply_permissions': + if (!isset($_POST['setting'])) + { + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action)); + } + + $this->set_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); + break; + + case 'apply_all_permissions': + if (!isset($_POST['setting'])) + { + trigger_error($user->lang['NO_AUTH_SETTING_FOUND'] . adm_back_link($this->u_action)); + } + + $this->set_all_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id); + break; + } + } + + + // Setting permissions screen + $s_hidden_fields = build_hidden_fields(array( + 'user_id' => $user_id, + 'group_id' => $group_id, + 'forum_id' => $forum_id, + 'type' => $permission_type) + ); + + if ($all_forums) + { + $s_hidden_fields .= build_hidden_fields(array('all_forums' => $all_forums)); + } + + // Go through the screens/options needed and present them in correct order + foreach ($permission_victim as $victim) + { + switch ($victim) + { + case 'forum_dropdown': + + if (sizeof($forum_id)) + { + $this->check_existence('forum', $forum_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_FORUM' => true, + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false)) + ); + + break; + + case 'forums': + + if (sizeof($forum_id) || $all_forums) + { + if (sizeof($forum_id)) + { + $this->check_existence('forum', $forum_id); + } + + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_FORUM' => true, + 'S_FORUM_OPTIONS' => make_forum_select(false, false, false), + 'S_FORUM_ALL' => true, + 'S_FORUM_MULTIPLE' => true) + ); + + break; + + case 'user': + + if (sizeof($user_id)) + { + $this->check_existence('user', $user_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_USER' => true, + 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=select_victim&field=username") + ); + + break; + + case 'group': + + if (sizeof($group_id)) + { + $this->check_existence('group', $group_id); + continue 2; + } + + $template->assign_vars(array( + 'S_SELECT_GROUP' => true, + 'S_GROUP_OPTIONS' => group_select_options(false)) + ); + + break; + + case 'usergroup': + case 'usergroup_view': + + if (sizeof($user_id) || sizeof($group_id)) + { + if (sizeof($user_id)) + { + $this->check_existence('user', $user_id); + } + + if (sizeof($group_id)) + { + $this->check_existence('group', $group_id); + } + + continue 2; + } + + $sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')' : 'AND a.forum_id <> 0'); + $sql_permission_option = "o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; + + $sql = 'SELECT DISTINCT u.user_id, u.username + FROM ' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o + WHERE $sql_permission_option + $sql_forum_id + AND a.auth_option_id = o.auth_option_id + AND u.user_id = a.user_id + ORDER BY u.username, u.user_regdate ASC"; + $result = $db->sql_query($sql); + + $s_defined_user_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $s_defined_user_options .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>'; + } + $db->sql_freeresult($result); + + $sql = 'SELECT DISTINCT g.group_id, g.group_name, g.group_type + FROM ' . GROUPS_TABLE . ' g, ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o + WHERE $sql_permission_option + $sql_forum_id + AND a.auth_option_id = o.auth_option_id + AND g.group_id = a.group_id + ORDER BY g.group_type DESC, g.group_name ASC"; + $result = $db->sql_query($sql); + + $s_defined_group_options = ''; + $defined_group_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; + $defined_group_ids[] = $row['group_id']; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_SELECT_USERGROUP' => ($victim == 'usergroup') ? true : false, + 'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false, + 'S_DEFINED_USER_OPTIONS' => $s_defined_user_options, + 'S_DEFINED_GROUP_OPTIONS' => $s_defined_group_options, + 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $defined_group_ids), + 'U_FIND_USERNAME' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=searchuser&form=add_user&field=username") + ); + + break; + } + + $template->assign_vars(array( + 'U_ACTION' => $this->u_action, + 'ANONYMOUS_USER_ID' => ANONYMOUS, + + 'S_SELECT_VICTIM' => true, + 'S_CAN_SELECT_USER' => ($auth->acl_get('a_authusers')) ? true : false, + 'S_CAN_SELECT_GROUP' => ($auth->acl_get('a_authgroups')) ? true : false, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + // Let the forum names being displayed + if (sizeof($forum_id)) + { + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id IN (' . implode(', ', $forum_id) . ') + ORDER BY forum_name ASC'; + $result = $db->sql_query($sql); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[] = $row['forum_name']; + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false, + 'FORUM_NAMES' => implode(', ', $forum_names)) + ); + } + + return; + } + + // Set to all forums if selected + if ($permission_scope == 'local' && $all_forums) + { + $forum_id = array(); + } + + // Do not allow forum_ids being set and no other setting defined (will bog down the server too much) + if (sizeof($forum_id) && !sizeof($user_id) && !sizeof($group_id)) + { + trigger_error($user->lang['ONLY_FORUM_DEFINED'] . adm_back_link($this->u_action)); + } + + $template->assign_vars(array( + 'S_PERMISSION_DROPDOWN' => (sizeof($this->permission_dropdown) > 1) ? $this->build_permission_dropdown($this->permission_dropdown, $permission_type) : false, + 'L_PERMISSION_TYPE' => $user->lang['ACL_TYPE_' . strtoupper($permission_type)], + + 'U_ACTION' => $this->u_action, + 'S_HIDDEN_FIELDS' => $s_hidden_fields) + ); + + if (strpos($mode, 'setting_') === 0) + { + $template->assign_vars(array( + 'S_SETTING_PERMISSIONS' => true) + ); + + $hold_ary = $auth_admin->get_mask('set', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_UNSET); + $auth_admin->display_mask('set', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false)); + } + else + { + $template->assign_vars(array( + 'S_VIEWING_PERMISSIONS' => true) + ); + + $hold_ary = $auth_admin->get_mask('view', (sizeof($user_id)) ? $user_id : false, (sizeof($group_id)) ? $group_id : false, (sizeof($forum_id)) ? $forum_id : false, $permission_type, $permission_scope, ACL_NO); + $auth_admin->display_mask('view', $permission_type, $hold_ary, ((sizeof($user_id)) ? 'user' : 'group'), (($permission_scope == 'local') ? true : false)); + } + } + + /** + * Build dropdown field for changing permission types + */ + function build_permission_dropdown($options, $default_option) + { + global $user, $auth; + + $s_dropdown_options = ''; + foreach ($options as $setting) + { + if (!$auth->acl_get('a_' . str_replace('_', '', $setting) . 'auth')) + { + continue; + } + $selected = ($setting == $default_option) ? ' selected="selected"' : ''; + $s_dropdown_options .= '<option value="' . $setting . '"' . $selected . '>' . $user->lang['permission_type'][$setting] . '</option>'; + } + + return $s_dropdown_options; + } + + /** + * Check if selected items exist. Remove not found ids and if empty return error. + */ + function check_existence($mode, &$ids) + { + global $db, $user; + + switch ($mode) + { + case 'user': + $table = USERS_TABLE; + $sql_id = 'user_id'; + break; + + case 'group': + $table = GROUPS_TABLE; + $sql_id = 'group_id'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $sql_id = 'forum_id'; + break; + } + + $sql = "SELECT $sql_id + FROM $table + WHERE $sql_id IN (" . implode(', ', $ids) . ')'; + $result = $db->sql_query($sql); + + $ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $ids[] = $row[$sql_id]; + } + $db->sql_freeresult($result); + + if (!sizeof($ids)) + { + trigger_error($user->lang['SELECTED_' . strtoupper($mode) . '_NOT_EXIST'] . adm_back_link($this->u_action)); + } + } + + /** + * Apply permissions + */ + function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + { + global $user, $auth; + + $psubmit = request_var('psubmit', array(0)); + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + } + + $ug_id = $forum_id = 0; + + // We loop through the auth settings defined in our submit + list($ug_id, ) = each($psubmit); + list($forum_id, ) = each($psubmit[$ug_id]); + + $auth_settings = array_map('intval', $_POST['setting'][$ug_id][$forum_id]); + + // Do the admin want to set these permissions to other forums too? + $inherit = request_var('inherit', array(0)); + + $ug_id = array($ug_id); + $forum_id = array($forum_id); + + if (sizeof($inherit)) + { + foreach ($inherit as $_ug_id => $forum_id_ary) + { + // Inherit users/groups? + if (!in_array($_ug_id, $ug_id)) + { + $ug_id[] = $_ug_id; + } + + // Inherit forums? + $forum_id = array_merge($forum_id, array_keys($forum_id_ary)); + } + } + + $forum_id = array_unique($forum_id); + + // Update the permission set... + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_settings); + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + cache_moderators(); + } + + // Remove users who are now moderators or admins from everyones foes list + if ($permission_type == 'm_' || $permission_type == 'a_') + { + $this->update_foes(); + } + + $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_id, $forum_id); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + + /** + * Apply all permissions + */ + function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + { + global $user, $auth; + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + } + + $auth_settings = $_POST['setting']; + $ug_ids = $forum_ids = array(); + + // We need to go through the auth settings + foreach ($auth_settings as $ug_id => $forum_auth_row) + { + $ug_id = (int) $ug_id; + $ug_ids[] = $ug_id; + + foreach ($forum_auth_row as $forum_id => $auth_options) + { + $forum_id = (int) $forum_id; + $forum_ids[] = $forum_id; + + // Update the permission set... + $auth_admin->acl_set($ug_type, $forum_id, $ug_id, $auth_options); + } + } + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + cache_moderators(); + } + + // Remove users who are now moderators or admins from everyones foes list + if ($permission_type == 'm_' || $permission_type == 'a_') + { + $this->update_foes(); + } + + $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + + /** + * Remove permissions + */ + function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id) + { + global $user, $db; + + // User or group to be set? + $ug_type = (sizeof($user_id)) ? 'user' : 'group'; + + // Check the permission setting again + if (!$auth->acl_get('a_' . str_replace('_', '', $permission_type) . 'auth') || !$auth->acl_get('a_auth' . $ug_type . 's')) + { + trigger_error($user->lang['NO_ADMIN'] . adm_back_link($this->u_action)); + } + + // Remove permission type + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option LIKE '{$permission_type}%'"; + $result = $db->sql_query($sql); + + $option_id_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $option_id_ary[] = $row['auth_option_id']; + } + $db->sql_freeresult($result); + + if (sizeof($option_id_ary)) + { + $auth_admin->acl_delete($ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : false), $option_id_ary); + } + + // Do we need to recache the moderator lists? + if ($permission_type == 'm_') + { + cache_moderators(); + } + + $this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0))); + + trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + } + + /** + * Log permission changes + */ + function log_action($mode, $action, $permission_type, $ug_type, $ug_id, $forum_id) + { + global $db, $user; + + if (!is_array($ug_id)) + { + $ug_id = array($ug_id); + } + + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // Logging ... first grab user or groupnames ... + $sql = ($ug_type == 'group') ? 'SELECT group_name as name, group_type FROM ' . GROUPS_TABLE . ' WHERE group_id' : 'SELECT username as name FROM ' . USERS_TABLE . ' WHERE user_id'; + $sql .= ' IN (' . implode(', ', array_map('intval', $ug_id)) . ')'; + $result = $db->sql_query($sql); + + $l_ug_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $l_ug_list .= (($l_ug_list != '') ? ', ' : '') . ((isset($row['group_type']) && $row['group_type'] == GROUP_SPECIAL) ? '<span class="blue">' . $user->lang['G_' . $row['name']] . '</span>' : $row['name']); + } + $db->sql_freeresult($result); + + $mode = str_replace('setting_', '', $mode); + + if ($forum_id[0] == 0) + { + add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_ug_list); + } + else + { + // Grab the forum details if non-zero forum_id + $sql = 'SELECT forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id IN (' . implode(', ', $forum_id) . ')'; + $result = $db->sql_query($sql); + + $l_forum_list = ''; + while ($row = $db->sql_fetchrow($result)) + { + $l_forum_list .= (($l_forum_list != '') ? ', ' : '') . $row['forum_name']; + } + $db->sql_freeresult($result); + + add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_forum_list, $l_ug_list); + } + } + + /** + * Update foes + */ + function update_foes() + { + global $db, $auth; + + $perms = array(); + foreach ($auth->acl_get_list(false, array('a_', 'm_'), false) as $forum_id => $forum_ary) + { + foreach ($forum_ary as $auth_option => $user_ary) + { + $perms += $user_ary; + } + } + + if (sizeof($perms)) + { + $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' + WHERE zebra_id IN (' . implode(', ', $perms) . ')'; + $db->sql_query($sql); + } + unset($perms); + } +} + +/** +* @package module_install +*/ +class acp_permissions_info +{ + function module() + { + return array( + 'filename' => 'acp_permissions', + 'title' => 'ACP_PERMISSIONS', + 'version' => '1.0.0', + 'modes' => array( + 'setting_user_global' => array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'), + 'setting_user_local' => array('title' => 'ACP_USERS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'), + 'setting_group_global' => array('title' => 'ACP_GROUPS_PERMISSIONS', 'auth' => 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'), + 'setting_group_local' => array('title' => 'ACP_GROUPS_FORUM_PERMISSIONS', 'auth' => 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'), + 'setting_admin_global' => array('title' => 'ACP_ADMINISTRATORS', 'auth' => 'acl_a_aauth && (acl_a_authusers || acl_a_authgroups)'), + 'setting_mod_global' => array('title' => 'ACP_GLOBAL_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'), + 'setting_mod_local' => array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'), + 'setting_forum_local' => array('title' => 'ACP_FORUM_PERMISSIONS', 'auth' => 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)'), + + 'view_admin_global' => array('title' => 'ACP_VIEW_ADMIN_PERMISSIONS', 'auth' => 'acl_a_viewauth'), + 'view_user_global' => array('title' => 'ACP_VIEW_USER_PERMISSIONS', 'auth' => 'acl_a_viewauth'), + 'view_mod_global' => array('title' => 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS', 'auth' => 'acl_a_viewauth'), + 'view_mod_local' => array('title' => 'ACP_VIEW_FORUM_MOD_PERMISSIONS', 'auth' => 'acl_a_viewauth'), + 'view_forum_local' => array('title' => 'ACP_VIEW_FORUM_PERMISSIONS', 'auth' => 'acl_a_viewauth'), + ), + ); + } + + function install() + { + } + + function uninstall() + { + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 35c5b223e6..87d74b8f3a 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -89,7 +89,7 @@ class acp_php_info_info 'title' => 'ACP_PHP_INFO', 'version' => '1.0.0', 'modes' => array( - 'info' => array('title' => 'ACP_PHP_INFO', 'auth' => 'acl_a_server'), + 'info' => array('title' => 'ACP_PHP_INFO', 'auth' => 'acl_a_phpinfo'), ), ); } diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index f7c3817c99..495f958481 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -1251,7 +1251,7 @@ class acp_profile_info 'title' => 'ACP_CUSTOM_PROFILE_FIELDS', 'version' => '1.0.0', 'modes' => array( - 'profile' => array('title' => 'ACP_CUSTOM_PROFILE_FIELDS', 'auth' => 'acl_a_user'), + 'profile' => array('title' => 'ACP_CUSTOM_PROFILE_FIELDS', 'auth' => 'acl_a_profile'), ), ); } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 2073f00e3c..fdb02fc42e 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1743,6 +1743,52 @@ class acp_users break; + case 'perm': + + include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx); + + $auth_admin = new auth_admin(); + + $user->add_lang('acp/permissions'); + $user->add_lang('acp/permissions_phpbb'); + + // Select auth options + $sql = 'SELECT auth_option, is_local, is_global + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option LIKE '%\_' + AND is_global = 1 + ORDER BY auth_option"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NO); + $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', false, false); + } + $db->sql_freeresult($result); + + $sql = 'SELECT auth_option, is_local, is_global + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option LIKE '%\_' + AND is_local = 1 + ORDER BY is_global DESC, auth_option"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'local', ACL_NO); + $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', true, false); + } + $db->sql_freeresult($result); + + $template->assign_vars(array( + 'S_PERMISSIONS' => true, + 'U_USER_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&i=permissions&mode=setting_user_global&user_id[]=' . $user_id, + 'U_USER_FORUM_PERMISSIONS' => $phpbb_admin_path . 'index.' . $phpEx . $SID . '&i=permissions&mode=setting_user_local&user_id[]=' . $user_id) + ); + + break; + } // Assign general variables @@ -1837,7 +1883,7 @@ class acp_users_info 'rank' => array('title' => 'ACP_USER_RANK', 'auth' => 'acl_a_user', 'display' => false), 'sig' => array('title' => 'ACP_USER_SIG', 'auth' => 'acl_a_user', 'display' => false), 'groups' => array('title' => 'ACP_USER_GROUPS', 'auth' => 'acl_a_user && acl_a_group', 'display' => false), - 'perm' => array('title' => 'ACP_USER_PERM', 'auth' => 'acl_a_user', 'display' => false), + 'perm' => array('title' => 'ACP_USER_PERM', 'auth' => 'acl_a_user && acl_a_viewauth', 'display' => false), 'attach' => array('title' => 'ACP_USER_ATTACH', 'auth' => 'acl_a_user', 'display' => false), ), ); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php new file mode 100644 index 0000000000..59a6b03d54 --- /dev/null +++ b/phpBB/includes/acp/auth.php @@ -0,0 +1,978 @@ +<?php +/** +* +* @package phpBB3 +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @package phpBB3 +* ACP Permission/Auth class +*/ +class auth_admin extends auth +{ + var $option_ids = array(); + + /** + * Init auth settings + */ + function auth_admin() + { + global $db, $cache; + + if (($this->acl_options = $cache->get('acl_options')) === false) + { + $sql = 'SELECT auth_option, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . ' + ORDER BY auth_option_id'; + $result = $db->sql_query($sql); + + $global = $local = 0; + while ($row = $db->sql_fetchrow($result)) + { + if ($row['is_global']) + { + $this->acl_options['global'][$row['auth_option']] = $global++; + } + + if ($row['is_local']) + { + $this->acl_options['local'][$row['auth_option']] = $local++; + } + } + $db->sql_freeresult($result); + + $cache->put('acl_options', $this->acl_options); + } + } + + /** + * Get permission mask + * This function only supports getting permissions of one type (for example a_) + * + * @param set|view $mode defines the permissions we get, view gets effective permissions (checking user AND group permissions), set only gets the user or group permission set alone + * @param mixed $user_id user ids to search for (a user_id or a group_id has to be specified at least) + * @param mixed $group_id group ids to search for, return group related settings (a user_id or a group_id has to be specified at least) + * @param mixed $forum_id forum_ids to search for. Defining a forum id also means getting local settings + * @param string $auth_option the auth_option defines the permission setting to look for (a_ for example) + * @param local|global $scope the scope defines the permission scope. If local, a forum_id is additionally required + * @param ACL_NO|ACL_UNSET|ACL_YES $acl_fill defines the mode those permissions not set are getting filled with + */ + function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NO) + { + global $db; + + $hold_ary = array(); + + if ($auth_option === false || $scope === false) + { + return array(); + } + + $acl_user_function = ($mode == 'set') ? 'acl_user_raw_data' : 'acl_raw_data'; + + if ($forum_id !== false) + { + $hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', $forum_id) : $this->$acl_user_function($user_id, $auth_option . '%', $forum_id); + } + else + { + $hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->$acl_user_function($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false); + } + + // Make sure hold_ary is filled with every setting (prevents missing forums/users/groups) + $ug_id = ($group_id !== false) ? ((!is_array($group_id)) ? array($group_id) : $group_id) : ((!is_array($user_id)) ? array($user_id) : $user_id); + $forum_ids = ($forum_id !== false) ? ((!is_array($forum_id)) ? array($forum_id) : $forum_id) : (($scope == 'global') ? array(0) : array()); + + // If forum_ids is false and the scope is local we actually want to have all forums within the array + if ($scope == 'local' && !sizeof($forum_ids)) + { + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql, 120); + + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + } + + foreach ($ug_id as $_id) + { + if (!isset($hold_ary[$_id])) + { + $hold_ary[$_id] = array(); + } + + foreach ($forum_ids as $f_id) + { + if (!isset($hold_ary[$_id][$f_id])) + { + $hold_ary[$_id][$f_id] = array(); + } + } + } + + // Now, we need to fill the gaps with $acl_fill. ;) + + // Only those options we need + $compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array('')); + + // Now switch back to keys + if (sizeof($compare_options)) + { + $compare_options = array_combine($compare_options, array_fill(1, sizeof($compare_options), $acl_fill)); + } + + // Defining the user-function here to save some memory + $return_acl_fill = create_function('$value', 'return ' . $acl_fill . ';'); + + // Actually fill the gaps + if (sizeof($hold_ary)) + { + foreach ($hold_ary as $ug_id => $row) + { + foreach ($row as $id => $options) + { + // Do not include the global auth_option + unset($options[$auth_option]); + + // Not a "fine" solution, but at all it's a 1-dimensional + // array_diff_key function filling the resulting array values with zeros + // The differences get merged into $hold_ary (all permissions having $acl_fill set) + $hold_ary[$ug_id][$id] = array_merge($options, + + array_map($return_acl_fill, + array_flip( + array_diff( + array_keys($compare_options), array_keys($options) + ) + ) + ) + ); + } + } + } + else + { + $hold_ary[($group_id !== false) ? $group_id : $user_id][(int) $forum_id] = $compare_options; + } + + return $hold_ary; + } + + /** + * Get permission mask for presets + * This function only supports getting masks for one preset + */ + function get_preset_mask($preset_id) + { + global $db; + + $hold_ary = array(); + + // Get users having this preset set... + $sql = 'SELECT user_id, forum_id + FROM ' . ACL_USERS_TABLE . ' + WHERE auth_preset_id = ' . $preset_id . ' + ORDER BY forum_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['forum_id']]['users'][] = $row['user_id']; + } + $db->sql_freeresult($result); + + // Now grab groups... + $sql = 'SELECT group_id, forum_id + FROM ' . ACL_GROUPS_TABLE . ' + WHERE auth_preset_id = ' . $preset_id . ' + ORDER BY forum_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['forum_id']]['groups'][] = $row['group_id']; + } + $db->sql_freeresult($result); + + return $hold_ary; + } + + /** + * Display permission mask for presets + */ + function display_preset_mask(&$hold_ary) + { + global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID; + + if (!sizeof($hold_ary)) + { + return; + } + + // Get forum names + $sql = 'SELECT forum_id, forum_name + FROM ' . FORUMS_TABLE . ' + WHERE forum_id IN (' . implode(', ', array_keys($hold_ary)) . ')'; + $result = $db->sql_query($sql); + + $forum_names = array(); + while ($row = $db->sql_fetchrow($result)) + { + $forum_names[$row['forum_id']] = $row['forum_name']; + } + $db->sql_freeresult($result); + + foreach ($hold_ary as $forum_id => $auth_ary) + { + $template->assign_block_vars('preset_mask', array( + 'NAME' => ($forum_id == 0) ? $user->lang['GLOBAL_MASK'] : $forum_names[$forum_id], + 'FORUM_ID' => $forum_id) + ); + + if (isset($auth_ary['users']) && sizeof($auth_ary['users'])) + { + $sql = 'SELECT user_id, username + FROM ' . USERS_TABLE . ' + WHERE user_id IN (' . implode(', ', $auth_ary['users']) . ') + ORDER BY username'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('preset_mask.users', array( + 'USER_ID' => $row['user_id'], + 'USERNAME' => $row['username'], + 'U_PROFILE' => "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['user_id']}") + ); + } + $db->sql_freeresult($result); + } + + if (isset($auth_ary['groups']) && sizeof($auth_ary['groups'])) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id IN (' . implode(', ', $auth_ary['groups']) . ') + ORDER BY group_type ASC, group_name'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $template->assign_block_vars('preset_mask.groups', array( + 'GROUP_ID' => $row['group_id'], + 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'], + 'U_PROFILE' => $phpbb_root_path . "memberlist.$phpEx$SID&mode=group&g={$row['group_id']}") + ); + } + $db->sql_freeresult($result); + } + } + } + + /** + * NOTE: this function is not in use atm + * Add a new option to the list ... $options is a hash of form -> + * $options = array( + * 'local' => array('option1', 'option2', ...), + * 'global' => array('optionA', 'optionB', ...) + * ); + */ + function acl_add_option($options) + { + global $db, $cache; + + if (!is_array($options)) + { + return false; + } + + $cur_options = array(); + + $sql = 'SELECT auth_option, is_global, is_local + FROM ' . ACL_OPTIONS_TABLE . ' + ORDER BY auth_option_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['is_global']) + { + $cur_options['global'][] = $row['auth_option']; + } + + if ($row['is_local']) + { + $cur_options['local'][] = $row['auth_option']; + } + } + $db->sql_freeresult($result); + + // Here we need to insert new options ... this requires discovering whether + // an options is global, local or both and whether we need to add an permission + // set flag (x_) + $new_options = array('local' => array(), 'global' => array()); + + foreach ($options as $type => $option_ary) + { + $option_ary = array_unique($option_ary); + + foreach ($option_ary as $option_value) + { + if (!in_array($option_value, $cur_options[$type])) + { + $new_options[$type][] = $option_value; + } + + $flag = substr($option_value, 0, strpos($option_value, '_') + 1); + + if (!in_array($flag, $cur_options[$type]) && !in_array($flag, $new_options[$type])) + { + $new_options[$type][] = $flag; + } + } + } + unset($options); + + $options = array(); + $options['local'] = array_diff($new_options['local'], $new_options['global']); + $options['global'] = array_diff($new_options['global'], $new_options['local']); + $options['local_global'] = array_intersect($new_options['local'], $new_options['global']); + + $sql_ary = array(); + + foreach ($options as $type => $option_ary) + { + foreach ($option_ary as $option) + { + $sql_ary[] = array( + 'auth_option' => $option, + 'is_global' => ($type == 'global' || $type == 'local_global') ? 1 : 0, + 'is_local' => ($type == 'local' || $type == 'local_global') ? 1 : 0 + ); + } + } + + if (sizeof($sql_ary)) + { + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_ary)); + break; + + default: + foreach ($sql_ary as $ary) + { + $db->sql_query('INSERT INTO ' . ACL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + } + break; + } + } + + $cache->destroy('acl_options'); + + return true; + } + + /** + * Set a preset ACL record + */ + function acl_set_preset($preset_id, &$auth) + { + global $db; + + if (!sizeof($this->option_ids)) + { + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE; + $result = $db->sql_query($sql); + + $this->option_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $this->option_ids[$row['auth_option']] = $row['auth_option_id']; + } + $db->sql_freeresult($result); + } + + // Set any flags as required + foreach ($auth as $auth_option => $setting) + { + $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); + + if (!isset($auth[$flag]) || !$auth[$flag]) + { + $auth[$flag] = $setting; + } + } + + $sql = 'SELECT auth_option_id, auth_setting + FROM ' . ACL_PRESETS_DATA_TABLE . ' + WHERE preset_id = ' . $preset_id; + $result = $db->sql_query($sql); + + $cur_auth = array(); + while ($row = $db->sql_fetchrow($result)) + { + $cur_auth[$row['auth_option_id']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + $sql_ary = array(); + + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = (int) $this->option_ids[$auth_option]; + + switch ($setting) + { + case ACL_UNSET: + if (isset($cur_auth[$auth_option_id])) + { + $sql_ary['delete'][] = 'DELETE FROM ' . ACL_PRESETS_DATA_TABLE . ' + WHERE auth_option_id = ' . $auth_option_id . ' + AND preset_id = ' . $preset_id; + } + break; + + default: + if (!isset($cur_auth[$auth_option_id])) + { + $sql_ary['insert'][] = array( + 'preset_id' => (int) $preset_id, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); + } + else if ($cur_auth[$auth_option_id] != $setting) + { + $sql_ary['update'][] = 'UPDATE ' . ACL_PRESETS_DATA_TABLE . ' + SET auth_setting = ' . (int) $setting . ' + WHERE preset_id = ' . $preset_id . ' + AND auth_option_id = ' . $auth_option_id; + } + break; + } + } + unset($cur_auth); + + foreach ($sql_ary as $sql_type => $sql_subary) + { + switch ($sql_type) + { + case 'insert': + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('MULTI_INSERT', $sql_subary)); + break; + + default: + foreach ($sql_subary as $ary) + { + $db->sql_query('INSERT INTO ' . ACL_PRESETS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $ary)); + } + break; + } + break; + + case 'update': + case 'delete': + foreach ($sql_subary as $sql) + { + $db->sql_query($sql); + } + break; + } + } + + $this->acl_clear_prefetch(); + } + + /** + * Set a user or group ACL record + */ + function acl_set($ug_type, &$forum_id, &$ug_id, &$auth) + { + global $db; + + // One or more forums + if (!is_array($forum_id)) + { + $forum_id = array($forum_id); + } + + // One or more users + if (!is_array($ug_id)) + { + $ug_id = array($ug_id); + } + + if (!sizeof($this->option_ids)) + { + $sql = 'SELECT auth_option_id, auth_option + FROM ' . ACL_OPTIONS_TABLE; + $result = $db->sql_query($sql); + + $this->option_ids = array(); + while ($row = $db->sql_fetchrow($result)) + { + $this->option_ids[$row['auth_option']] = $row['auth_option_id']; + } + $db->sql_freeresult($result); + } + + $ug_id_sql = 'IN (' . implode(', ', array_map('intval', $ug_id)) . ')'; + $forum_sql = 'IN (' . implode(', ', array_map('intval', $forum_id)) . ') '; + + // Set any flags as required + foreach ($auth as $auth_option => $setting) + { + $flag = substr($auth_option, 0, strpos($auth_option, '_') + 1); + + if (!isset($auth[$flag]) || !$auth[$flag]) + { + $auth[$flag] = $setting; + } + } + + if ($ug_type == 'user') + { + $sql = 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o + WHERE a.auth_option_id = o.auth_option_id + AND a.forum_id $forum_sql + AND a.user_id $ug_id_sql"; + } + else + { + $sql = 'SELECT o.auth_option_id, o.auth_option, a.forum_id, a.auth_setting + FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . " o + WHERE a.auth_option_id = o.auth_option_id + AND a.forum_id $forum_sql + AND a.group_id $ug_id_sql"; + } + $result = $db->sql_query($sql); + + $cur_auth = array(); + while ($row = $db->sql_fetchrow($result)) + { + $cur_auth[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + $table = ($ug_type == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; + $id_field = $ug_type . '_id'; + + $sql_ary = array(); + foreach ($forum_id as $forum) + { + $forum = (int) $forum; + + foreach ($auth as $auth_option => $setting) + { + $auth_option_id = (int) $this->option_ids[$auth_option]; + + switch ($setting) + { + case ACL_UNSET: + if (isset($cur_auth[$forum][$auth_option_id])) + { + $sql_ary['delete'][] = "DELETE FROM $table + WHERE forum_id = $forum + AND auth_option_id = $auth_option_id + AND $id_field $ug_id_sql"; + } + break; + + default: + if (!isset($cur_auth[$forum][$auth_option_id])) + { + foreach ($ug_id as $id) + { + $sql_ary['insert'][] = array( + $id_field => (int) $id, + 'forum_id' => (int) $forum, + 'auth_option_id' => (int) $auth_option_id, + 'auth_setting' => (int) $setting + ); + } + } + else if ($cur_auth[$forum][$auth_option_id] != $setting) + { + $sql_ary['update'][] = "UPDATE $table + SET auth_setting = " . (int) $setting . " + WHERE $id_field $ug_id_sql + AND forum_id = $forum + AND auth_option_id = $auth_option_id"; + } + break; + } + } + } + unset($cur_auth); + + foreach ($sql_ary as $sql_type => $sql_subary) + { + switch ($sql_type) + { + case 'insert': + switch (SQL_LAYER) + { + case 'mysql': + case 'mysql4': + case 'mysqli': + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('MULTI_INSERT', $sql_subary)); + break; + + default: + foreach ($sql_subary as $ary) + { + $db->sql_query("INSERT INTO $table " . $db->sql_build_array('INSERT', $ary)); + } + break; + } + break; + + case 'update': + case 'delete': + foreach ($sql_subary as $sql) + { + $db->sql_query($sql); + } + break; + } + } + + $this->acl_clear_prefetch(); + } + + /** + * Remove local permission + */ + function acl_delete($mode, $ug_id = false, $forum_id = false, $auth_id = false) + { + global $db; + + if ($ug_id === false && $forum_id === false && $auth_ids === false) + { + return; + } + + $table = ($mode == 'user') ? ACL_USERS_TABLE : ACL_GROUPS_TABLE; + $id_field = $mode . '_id'; + + $sql = array(); + + if ($auth_id !== false) + { + $sql[] = (!is_array($auth_id)) ? 'auth_option_id = ' . (int) $auth_id : 'auth_option_id IN (' . implode(', ', array_map('intval', $auth_id)) . ')'; + } + + if ($forum_id !== false) + { + $sql[] = (!is_array($forum_id)) ? 'forum_id = ' . (int) $forum_id : 'forum_id IN (' . implode(', ', array_map('intval', $forum_id)) . ')'; + } + + if ($ug_id !== false) + { + $sql[] = (!is_array($ug_id)) ? $id_field . ' = ' . (int) $ug_id : $id_field . ' IN (' . implode(', ', array_map('intval', $ug_id)) . ')'; + } + + $sql = "DELETE FROM $table + WHERE " . implode(' AND ', $sql); + $db->sql_query($sql); + + $this->acl_clear_prefetch(); + } + + /** + * Display permission mask (assign to template) + */ + function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true) + { + global $template, $user, $db, $phpbb_root_path, $phpEx, $SID; + + // Define names for template loops, might be able to be set + $tpl_pmask = 'p_mask'; + $tpl_fmask = 'f_mask'; + $tpl_category = 'category'; + $tpl_mask = 'mask'; + + $l_acl_type = (isset($user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)])) ? $user->lang['ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type)] : 'ACL_TYPE_' . (($local) ? 'LOCAL' : 'GLOBAL') . '_' . strtoupper($permission_type); + + // Get names + if ($user_mode == 'user') + { + $sql = 'SELECT user_id as ug_id, username as ug_name + FROM ' . USERS_TABLE . ' + WHERE user_id IN (' . implode(', ', array_keys($hold_ary)) . ') + ORDER BY username ASC'; + } + else + { + $sql = 'SELECT group_id as ug_id, group_name as ug_name, group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id IN (' . implode(', ', array_keys($hold_ary)) . ') + ORDER BY group_type DESC, group_name ASC'; + } + $result = $db->sql_query($sql); + + $ug_names_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']); + } + $db->sql_freeresult($result); + + // Get used forums + $forum_ids = array(); + foreach ($hold_ary as $ug_id => $row) + { + $forum_ids = array_merge($forum_ids, array_keys($row)); + } + $forum_ids = array_unique($forum_ids); + + $forum_names_ary = array(); + if ($local) + { + $forum_names_ary = make_forum_select(false, false, true, false, false, true); + } + else + { + $forum_names_ary[0] = $l_acl_type; + } + + // Now obtain memberships + $user_groups_default = $user_groups_custom = array(); + if ($user_mode == 'user' && $group_display) + { + $sql = 'SELECT group_id, group_name, group_type + FROM ' . GROUPS_TABLE . ' + ORDER BY group_type DESC, group_name ASC'; + $result = $db->sql_query($sql); + + $groups = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups[$row['group_id']] = $row; + } + $db->sql_freeresult($result); + + $memberships = group_memberships(false, array_keys($hold_ary), false); + + foreach ($memberships as $row) + { + if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL) + { + $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']]; + } + else + { + $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name']; + } + } + unset($memberships, $groups); + } + + // If we only have one forum id to display, we switch the complete interface to group by user/usergroup instead of grouping by forum + // To achive this, we need to switch the array a bit + if (sizeof($forum_ids) == 1) + { + $hold_ary_temp = $hold_ary; + $hold_ary = array(); + foreach ($hold_ary_temp as $ug_id => $row) + { + foreach ($row as $forum_id => $auth_row) + { + $hold_ary[$forum_id][$ug_id] = $auth_row; + } + } + unset($hold_ary_temp); + + foreach ($hold_ary as $forum_id => $forum_array) + { + $content_array = $categories = array(); + $this->build_permission_array($hold_ary[$forum_id], $content_array, $categories, array_keys($ug_names_ary)); + + $template->assign_block_vars($tpl_pmask, array( + 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'], + 'CATEGORIES' => implode('</th><th>', $categories), + + 'L_ACL_TYPE' => $l_acl_type, + + 'S_LOCAL' => ($local) ? true : false, + 'S_GLOBAL' => (!$local) ? true : false, + 'S_NUM_CATS' => sizeof($categories), + 'S_VIEW' => ($mode == 'view') ? true : false, + 'S_NUM_OBJECTS' => sizeof($content_array), + 'S_USER_MODE' => ($user_mode == 'user') ? true : false, + 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) + ); + + foreach ($content_array as $ug_id => $ug_array) + { + $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array( + 'NAME' => $ug_names_ary[$ug_id], + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id) + ); + + $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id); + } + } + } + else + { + foreach ($ug_names_ary as $ug_id => $ug_name) + { + if (!isset($hold_ary[$ug_id])) + { + continue; + } + + $content_array = $categories = array(); + $this->build_permission_array($hold_ary[$ug_id], $content_array, $categories, array_keys($forum_names_ary)); + + $template->assign_block_vars($tpl_pmask, array( + 'NAME' => $ug_name, + 'CATEGORIES' => implode('</th><th>', $categories), + + 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '', + 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '', + 'L_ACL_TYPE' => $l_acl_type, + + 'S_LOCAL' => ($local) ? true : false, + 'S_GLOBAL' => (!$local) ? true : false, + 'S_NUM_CATS' => sizeof($categories), + 'S_VIEW' => ($mode == 'view') ? true : false, + 'S_NUM_OBJECTS' => sizeof($content_array), + 'S_USER_MODE' => ($user_mode == 'user') ? true : false, + 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) + ); + + foreach ($content_array as $forum_id => $forum_array) + { + $template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array( + 'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'], + 'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'], + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id) + ); + + $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id); + } + } + } + } + + /** + * Assign category to template + * used by display_mask() + */ + function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id) + { + global $template, $user; + + foreach ($category_array as $cat => $cat_array) + { + $template->assign_block_vars($tpl_cat, array( + 'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NO'] && !$cat_array['S_UNSET']) ? true : false, + 'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_YES'] && !$cat_array['S_UNSET']) ? true : false, + 'S_UNSET' => ($cat_array['S_UNSET'] && !$cat_array['S_NO'] && !$cat_array['S_YES']) ? true : false, + + 'CAT_NAME' => $user->lang['permission_cat'][$cat]) + ); + + foreach ($cat_array['permissions'] as $permission => $allowed) + { + $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( + 'S_YES' => ($allowed == 1) ? true : false, + 'S_NO' => ($allowed == 0) ? true : false, + 'S_UNSET' => ($allowed == -1) ? true : false, + + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id, + 'FIELD_NAME' => $permission, + 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', + + 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) + ); + } + } + } + + /** + * Building content array from permission rows with explicit key ordering + * used by display_mask() + */ + function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array) + { + global $user; + + foreach ($key_sort_array as $forum_id) + { + if (!isset($permission_row[$forum_id])) + { + continue; + } + + $permissions = $permission_row[$forum_id]; + ksort($permissions); + + foreach ($permissions as $permission => $auth_setting) + { + if (!isset($user->lang['acl_' . $permission])) + { + $user->lang['acl_' . $permission] = array( + 'cat' => 'misc', + 'lang' => '{ acl_' . $permission . ' }' + ); + } + + $cat = $user->lang['acl_' . $permission]['cat']; + + // Build our categories array + if (!isset($categories[$cat])) + { + $categories[$cat] = $user->lang['permission_cat'][$cat]; + } + + // Build our content array + if (!isset($content_array[$forum_id])) + { + $content_array[$forum_id] = array(); + } + + if (!isset($content_array[$forum_id][$cat])) + { + $content_array[$forum_id][$cat] = array( + 'S_YES' => false, + 'S_NO' => false, + 'S_UNSET' => false, + 'permissions' => array(), + ); + } + + $content_array[$forum_id][$cat]['S_YES'] |= ($auth_setting == ACL_YES) ? true : false; + $content_array[$forum_id][$cat]['S_NO'] |= ($auth_setting == ACL_NO) ? true : false; + $content_array[$forum_id][$cat]['S_UNSET'] |= ($auth_setting == ACL_UNSET) ? true : false; + + $content_array[$forum_id][$cat]['permissions'][$permission] = $auth_setting; + } + } + } +} + +?>
\ No newline at end of file diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 9608909088..ad6de1d6a8 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -494,6 +494,52 @@ class auth } /** + * Get raw user based permission settings + */ + function acl_user_raw_data($user_id = false, $opts = false, $forum_id = false) + { + global $db; + + $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : 'user_id IN (' . implode(', ', $user_id) . ')') : ''; + $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')') : ''; + + $sql_opts = ''; + + if ($opts !== false) + { + if (!is_array($opts)) + { + $sql_opts = (strpos($opts, '%') !== false) ? "AND ao.auth_option LIKE '" . $db->sql_escape($opts) . "'" : "AND ao.auth_option = '" . $db->sql_escape($opts) . "'"; + } + else + { + $sql_opts = 'AND ao.auth_option IN (' . implode(', ', preg_replace('#^\s*(.*)\s*$#e', "\"'\" . \$db->sql_escape('\\1') . \"'\"", $opts)) . ')'; + } + } + + $hold_ary = array(); + + // Grab user settings ... each user has only one setting for each + // option ... so we shouldn't need any ACL_NO checks ... he says ... + $sql = 'SELECT ao.auth_option, a.user_id, a.forum_id, a.auth_setting + FROM ' . ACL_OPTIONS_TABLE . ' ao, ' . ACL_USERS_TABLE . ' a + WHERE ao.auth_option_id = a.auth_option_id + ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + + return $hold_ary; + } + + /** * Get raw group based permission settings */ function acl_group_raw_data($group_id = false, $opts = false, $forum_id = false) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 0f1ccafe38..3a25de7942 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -117,8 +117,8 @@ define('FIELD_DATE', 6); // Table names define('ACL_GROUPS_TABLE', $table_prefix.'auth_groups'); define('ACL_OPTIONS_TABLE', $table_prefix.'auth_options'); -define('ACL_DEPS_TABLE', $table_prefix.'auth_deps'); define('ACL_PRESETS_TABLE', $table_prefix.'auth_presets'); +define('ACL_PRESETS_DATA_TABLE', $table_prefix.'auth_preset_data'); define('ACL_USERS_TABLE', $table_prefix.'auth_users'); define('ATTACHMENTS_TABLE', $table_prefix.'attachments'); define('BANLIST_TABLE', $table_prefix.'banlist'); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 68f2f97ade..bce4398cb3 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -205,11 +205,13 @@ class dbal // Show complete SQL error and path to administrators only if ($auth->acl_get('a_')) - { - $this_page = (isset($_SERVER['PHP_SELF']) && !empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']; - $this_page .= '&' . ((isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : (isset($_ENV['QUERY_STRING']) ? $_ENV['QUERY_STRING'] : '')); + { + // Print out a nice backtrace... + $backtrace = get_backtrace(); - $message .= '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />'; + $message .= ($sql) ? '<br /><br /><u>SQL</u><br /><br />' . $sql : ''; + $message .= ($backtrace) ? '<br /><br /><u>BACKTRACE</u><br />' . $backtrace : ''; + $message .= '<br />'; } else { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a5c96f5031..c139eb5a11 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2165,4 +2165,76 @@ function page_footer() exit; } +/** +* Return a nicely formatted backtrace (parts from the php manual by diz at ysagoon dot com) +*/ +function get_backtrace() +{ + global $phpbb_root_path; + + $output = '<div style="font-family: monospace;">'; + $backtrace = debug_backtrace(); + $path = realpath($phpbb_root_path); + + foreach ($backtrace as $number => $trace) + { + // We skip the first one, because it only shows this file/function + if ($number == 0) + { + continue; + } + + // Strip the current directory from path + $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']); + $trace['file'] = substr($trace['file'], 1); + + $args = array(); + foreach ($trace['args'] as $argument) + { + switch (gettype($argument)) + { + case 'integer': + case 'double': + $args[] = $argument; + break; + + case 'string': + $argument = htmlspecialchars(substr($argument, 0, 64)) . ((strlen($argument) > 64) ? '...' : ''); + $args[] = '"' . $argument . '"'; + break; + + case 'array': + $args[] = 'Array(' . sizeof($argument) . ')'; + break; + + case 'object': + $args[] = 'Object(' . get_class($argument) . ')'; + break; + + case 'resource': + $args[] = 'Resource(' . strstr($a, '#') . ')'; + break; + + case 'boolean': + $args[] = ($argument) ? 'true' : 'false'; + break; + + case 'NULL': + $args[] = 'NULL'; + break; + + default: + $args[] = 'Unknown'; + } + } + + $output .= '<br />'; + $output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />'; + $output .= '<b>LINE:</b> ' . $trace['line'] . '<br />'; + $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />'; + } + $output .= '</div>'; + return $output; +} + ?>
\ No newline at end of file diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 32cb2b383d..1aa18b467f 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1,7 +1,7 @@ <?php /** * -* @package phpBB3 +* @package acp * @version $Id$ * @copyright (c) 2005 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index a0708e88bb..5668fee1d0 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -923,15 +923,16 @@ function validate_email($email) return 'EMAIL_INVALID'; } - $banned = false; - - // TODO: This is a duplication of code from session->check_ban() + /** + * @todo This is a duplication of code from session->check_ban() + */ $sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end FROM ' . BANLIST_TABLE . ' WHERE ban_end >= ' . time() . ' OR ban_end = 0'; $result = $db->sql_query($sql); + $banned = false; if ($row = $db->sql_fetchrow($result)) { do diff --git a/phpBB/index.php b/phpBB/index.php index 97bf667475..81ce34574f 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -48,7 +48,6 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); - // Generate birthday list if required ... $birthday_list = ''; if ($config['load_birthdays']) diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 813f490b1f..62dbf6a1a0 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -27,6 +27,7 @@ CREATE TABLE phpbb_auth_groups ( group_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, auth_option_id INTEGER DEFAULT 0 NOT NULL, + auth_preset_id INTEGER DEFAULT 0 NOT NULL, auth_setting INTEGER DEFAULT 0 NOT NULL );; @@ -43,16 +44,23 @@ CREATE TABLE phpbb_auth_options ( CREATE TABLE phpbb_auth_presets ( preset_id INTEGER NOT NULL, preset_name VARCHAR(50) NOT NULL, - preset_user_id INTEGER DEFAULT 0 NOT NULL, - preset_type VARCHAR(2) NOT NULL, - preset_data BLOB SUB_TYPE TEXT NOT NULL + preset_type VARCHAR(10) NOT NULL, + preset_group_id INTEGER DEFAULT 0 NOT NULL );; +# phpbb_auth_preset_data +CREATE TABLE phpbb_auth_preset_data ( + preset_id INTEGER DEFAULT 0 NOT NULL, + auth_option_id INTEGER DEFAULT 0 NOT NULL, + auth_setting INTEGER DEFAULT 0 NOT NULL +); + # phpbb_auth_users CREATE TABLE phpbb_auth_users ( user_id INTEGER DEFAULT 0 NOT NULL, forum_id INTEGER DEFAULT 0 NOT NULL, auth_option_id INTEGER DEFAULT 0 NOT NULL, + auth_preset_id INTEGER DEFAULT 0 NOT NULL, auth_setting INTEGER DEFAULT 0 NOT NULL );; @@ -880,6 +888,12 @@ ON phpbb_auth_presets( preset_type );; +ALTER TABLE phpbb_auth_preset_data +ADD PRIMARY KEY ( + preset_id, + auth_option_id +);; + CREATE INDEX auth_option_id11 ON phpbb_auth_users( auth_option_id diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 8afbf3cede..492a54fba4 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -32,6 +32,7 @@ CREATE TABLE [phpbb_auth_groups] ( [group_id] [int] NOT NULL , [forum_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , + [auth_preset_id] [int] NOT NULL , [auth_setting] [int] NOT NULL ) ON [PRIMARY] GO @@ -48,16 +49,23 @@ GO CREATE TABLE [phpbb_auth_presets] ( [preset_id] [int] IDENTITY (1, 1) NOT NULL , [preset_name] [varchar] (50) NOT NULL , - [preset_user_id] [int] NOT NULL , - [preset_type] [varchar] (2) NOT NULL , - [preset_data] [text] NOT NULL + [preset_type] [varchar] (10) NOT NULL , + [preset_group_id] [int] NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO +CREATE TABLE [phpbb_auth_preset_data] ( + [preset_id] [int] NOT NULL , + [auth_option_id] [int] NOT NULL , + [auth_setting] [int] NOT NULL +) ON [PRIMARY] +GO + CREATE TABLE [phpbb_auth_users] ( [user_id] [int] NOT NULL , [forum_id] [int] NOT NULL , [auth_option_id] [int] NOT NULL , + [auth_preset_id] [int] NOT NULL , [auth_setting] [int] NOT NULL ) ON [PRIMARY] GO @@ -845,6 +853,14 @@ ALTER TABLE [phpbb_auth_presets] WITH NOCHECK ADD ) ON [PRIMARY] GO +ALTER TABLE [phpbb_auth_preset_data] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_auth_preset_data] PRIMARY KEY CLUSTERED + ( + [preset_id], + [auth_option_id] + ) ON [PRIMARY] +GO + ALTER TABLE [phpbb_banlist] WITH NOCHECK ADD CONSTRAINT [PK_phpbb_banlist] PRIMARY KEY CLUSTERED ( @@ -1188,7 +1204,13 @@ ALTER TABLE [phpbb_auth_options] WITH NOCHECK ADD GO ALTER TABLE [phpbb_auth_presets] WITH NOCHECK ADD - CONSTRAINT [DF_auth_p_preset_user_id] DEFAULT (0) FOR [preset_user_id] + CONSTRAINT [DF_auth_p_preset_group_id] DEFAULT (0) FOR [preset_group_id] +GO + +ALTER TABLE [phpbb_auth_preset_data] WITH NOCHECK ADD + CONSTRAINT [DF_auth_d_preset_id] DEFAULT (0) FOR [preset_id], + CONSTRAINT [DF_auth_d_auth_option_id] DEFAULT (0) FOR [auth_option_id], + CONSTRAINT [DF_auth_d_auth_setting] DEFAULT (0) FOR [auth_setting] GO ALTER TABLE [phpbb_auth_users] WITH NOCHECK ADD diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 2440791e4b..51169b2bad 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -33,15 +33,16 @@ CREATE TABLE phpbb_attachments ( CREATE TABLE phpbb_auth_groups ( group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - auth_option_id smallint(5) UNSIGNED DEFAULT '0' NOT NULL, - auth_setting tinyint(4) DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY group_id (group_id), KEY auth_option_id (auth_option_id) ); # Table: phpbb_auth_options CREATE TABLE phpbb_auth_options ( - auth_option_id smallint(5) UNSIGNED NOT NULL auto_increment, + auth_option_id mediumint(8) UNSIGNED NOT NULL auto_increment, auth_option char(20) NOT NULL, is_global tinyint(1) DEFAULT '0' NOT NULL, is_local tinyint(1) DEFAULT '0' NOT NULL, @@ -52,21 +53,29 @@ CREATE TABLE phpbb_auth_options ( # Table: phpbb_auth_presets CREATE TABLE phpbb_auth_presets ( - preset_id tinyint(4) NOT NULL auto_increment, + preset_id mediumint(8) UNSIGNED NOT NULL auto_increment, preset_name varchar(50) DEFAULT '' NOT NULL, - preset_user_id mediumint(5) UNSIGNED DEFAULT '0' NOT NULL, - preset_type varchar(2) DEFAULT '' NOT NULL, - preset_data text DEFAULT '' NOT NULL, + preset_type varchar(10) DEFAULT '' NOT NULL, + preset_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (preset_id), KEY preset_type (preset_type) ); +# Table: phpbb_auth_preset_data +CREATE TABLE phpbb_auth_preset_data ( + preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, + PRIMARY KEY (preset_id, auth_option_id) +); + # Table: phpbb_auth_users CREATE TABLE phpbb_auth_users ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - auth_option_id smallint(5) UNSIGNED DEFAULT '0' NOT NULL, - auth_setting tinyint(4) DEFAULT '0' NOT NULL, + auth_option_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_preset_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + auth_setting tinyint(2) DEFAULT '0' NOT NULL, KEY user_id (user_id), KEY auth_option_id (auth_option_id) ); diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 30d818fd0d..5760ffabbc 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -95,7 +95,8 @@ CREATE INDEX filesize on phpbb_attachments (filesize) CREATE TABLE phpbb_auth_groups ( group_id number(8) DEFAULT '0' NOT NULL, forum_id number(8) DEFAULT '0' NOT NULL, - auth_option_id number(5) DEFAULT '0' NOT NULL, + auth_option_id number(8) DEFAULT '0' NOT NULL, + auth_preset_id number(8) DEFAULT '0' NOT NULL, auth_setting number(4) DEFAULT '0' NOT NULL ) / @@ -109,7 +110,7 @@ CREATE INDEX auth_option_id on phpbb_auth_groups (auth_option_id) Table: phpbb_auth_options */ CREATE TABLE phpbb_auth_options ( - auth_option_id number(5) NOT NULL, + auth_option_id number(8) NOT NULL, auth_option varchar2(20), is_global number(1) DEFAULT '0' NOT NULL, is_local number(1) DEFAULT '0' NOT NULL, @@ -140,11 +141,10 @@ CREATE INDEX auth_option on phpbb_auth_options (auth_option) Table: phpbb_auth_presets */ CREATE TABLE phpbb_auth_presets ( - preset_id number(4) NOT NULL, + preset_id number(8) NOT NULL, preset_name varchar2(50) DEFAULT '', - preset_user_id number(5) DEFAULT '0' NOT NULL, - preset_type varchar2(2) DEFAULT '', - preset_data clob DEFAULT '', + preset_type varchar2(10) DEFAULT '', + preset_group_id number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_auth_presets PRIMARY KEY (preset_id) ) / @@ -168,12 +168,24 @@ CREATE INDEX preset_type on phpbb_auth_presets (preset_type) / /* + Table: phpbb_auth_preset_data +*/ +CREATE TABLE phpbb_auth_preset_data ( + preset_id number(8) DEFAULT '0' NOT NULL, + auth_option_id number(8) DEFAULT '0' NOT NULL, + auth_setting number(4) DEFAULT '0' NOT NULL, + CONSTRAINT pk_phpbb_confirm PRIMARY KEY (preset_id, auth_option_id) +) +/ + +/* Table: phpbb_auth_users */ CREATE TABLE phpbb_auth_users ( user_id number(8) DEFAULT '0' NOT NULL, forum_id number(8) DEFAULT '0' NOT NULL, - auth_option_id number(5) DEFAULT '0' NOT NULL, + auth_option_id number(8) DEFAULT '0' NOT NULL, + auth_preset_id number(8) DEFAULT '0' NOT NULL, auth_setting number(4) DEFAULT '0' NOT NULL ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index e34319427a..68f44dd35f 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -48,7 +48,8 @@ SELECT SETVAL('phpbb_attachments_attach_id_',(select case when max(attach_id)>0 CREATE TABLE phpbb_auth_groups ( group_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, - auth_option_id INT2 DEFAULT '0' NOT NULL, + auth_option_id INT4 DEFAULT '0' NOT NULL, + auth_preset_id INT4 DEFAULT '0' NOT NULL, auth_setting INT2 DEFAULT '0' NOT NULL ); @@ -59,7 +60,7 @@ CREATE INDEX auth_option_id_phpbb_auth_groups_index ON phpbb_auth_groups (auth_o CREATE SEQUENCE phpbb_auth_options_auth_opti; CREATE TABLE phpbb_auth_options ( - auth_option_id INT2 DEFAULT nextval('phpbb_auth_options_auth_opti'), + auth_option_id INT4 DEFAULT nextval('phpbb_auth_options_auth_opti'), auth_option varchar(20) NOT NULL, is_global INT2 DEFAULT '0' NOT NULL, is_local INT2 DEFAULT '0' NOT NULL, @@ -75,24 +76,31 @@ SELECT SETVAL('phpbb_auth_options_auth_opti',(select case when max(auth_option_i CREATE SEQUENCE phpbb_auth_presets_preset_id; CREATE TABLE phpbb_auth_presets ( - preset_id INT2 DEFAULT nextval('phpbb_auth_presets_preset_id'), + preset_id INT4 DEFAULT nextval('phpbb_auth_presets_preset_id'), preset_name varchar(50) DEFAULT '' NOT NULL, - preset_user_id INT4 DEFAULT '0' NOT NULL, - preset_type varchar(2) DEFAULT '' NOT NULL, - preset_data text DEFAULT '' NOT NULL, - PRIMARY KEY (preset_id), - CHECK (preset_user_id>=0) + preset_type varchar(10) DEFAULT '' NOT NULL, + preset_group_id INT4 DEFAULT '0' NOT NULL, + PRIMARY KEY (preset_id) ); CREATE INDEX preset_type_phpbb_auth_presets_index ON phpbb_auth_presets (preset_type); SELECT SETVAL('phpbb_auth_presets_preset_id',(select case when max(preset_id)>0 then max(preset_id)+1 else 1 end from phpbb_auth_presets)); +/* Table: phpbb_auth_preset_data */ +CREATE TABLE phpbb_auth_preset_data ( + preset_id INT4 DEFAULT '0' NOT NULL, + auth_option_id INT4 DEFAULT '0' NOT NULL, + auth_setting INT2 DEFAULT '0' NOT NULL, + PRIMARY KEY (preset_id, auth_option_id) +); + /* Table: phpbb_auth_users */ CREATE TABLE phpbb_auth_users ( user_id INT4 DEFAULT '0' NOT NULL, forum_id INT4 DEFAULT '0' NOT NULL, - auth_option_id INT2 DEFAULT '0' NOT NULL, + auth_option_id INT4 DEFAULT '0' NOT NULL, + auth_preset_id INT4 DEFAULT '0' NOT NULL, auth_setting INT2 DEFAULT '0' NOT NULL ); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 0a6dddfe8b..fefbbd4b01 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -253,18 +253,21 @@ INSERT INTO phpbb_auth_options (auth_option, is_local, is_global) VALUES ('m_inf INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_server', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_jabber', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_defaults', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_board', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_cookies', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_phpinfo', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_clearlogs', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewlogs', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_words', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_icons', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bbcode', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_attach', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_email', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_styles', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_bots', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_user', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_useradd', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_userdel', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ranks', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_ban', 1); @@ -276,17 +279,16 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forum', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forumadd', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_forumdel', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_prune', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_auth', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authmods', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authadmins', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authusers', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_profile', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_modules', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_language', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_viewauth', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_fauth', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_mauth', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_aauth', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_uauth', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authgroups', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authdeps', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_backup', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_restore', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_search', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_events', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_cron', 1); +INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('a_authusers', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sendemail', 1); @@ -469,90 +471,104 @@ INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (90, 1, 'pm', 'ucp', 0, 27, 98, 99, 'UCP_PM_POPUP_TITLE', 'popup', 'cfg_allow_privmsg'); # ACP -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (2, 1, '', 'acp', 1, 0, 169, 204, 'ACP_CAT_GENERAL', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (7, 1, 'modules', 'acp', 1, 67, 327, 328, 'ACP', 'acp', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (11, 1, '', 'acp', 1, 0, 239, 282, 'ACP_CAT_USERGROUP', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (41, 1, 'main', 'acp', 1, 2, 170, 171, 'ACP_MAIN', 'main', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (42, 1, '', 'acp', 1, 2, 172, 183, 'ACP_GENERAL_CONFIGURATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (43, 1, '', 'acp', 1, 2, 184, 191, 'ACP_CLIENT_COMMUNICATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (44, 1, '', 'acp', 1, 2, 192, 203, 'ACP_SERVER_CONFIGURATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (46, 1, '', 'acp', 1, 0, 205, 214, 'ACP_CAT_FORUMS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (47, 1, '', 'acp', 1, 0, 215, 238, 'ACP_CAT_POSTING', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (48, 1, '', 'acp', 1, 0, 283, 288, 'ACP_CAT_PERMISSIONS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (49, 1, '', 'acp', 1, 0, 289, 302, 'ACP_CAT_STYLES', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (50, 1, '', 'acp', 1, 0, 303, 314, 'ACP_CAT_MAINTANENCE', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (51, 1, '', 'acp', 1, 0, 315, 334, 'ACP_CAT_SYSTEM', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (52, 1, '', 'acp', 1, 0, 335, 336, 'ACP_CAT_DOT_MODS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (53, 1, '', 'acp', 1, 46, 206, 211, 'ACP_CAT_FORUMS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (54, 1, '', 'acp', 1, 46, 212, 213, 'ACP_CAT_PERMISSIONS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (56, 1, '', 'acp', 1, 47, 228, 237, 'ACP_ATTACHMENTS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (57, 1, '', 'acp', 1, 11, 240, 265, 'ACP_CAT_USERS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (58, 1, '', 'acp', 1, 11, 266, 269, 'ACP_GROUPS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (59, 1, '', 'acp', 1, 11, 270, 281, 'ACP_USER_SECURITY', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (60, 1, '', 'acp', 1, 48, 284, 285, 'ACP_CAT_GENERAL', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (61, 1, '', 'acp', 1, 48, 286, 287, 'ACP_PERMISSION_SETTINGS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (62, 1, '', 'acp', 1, 49, 290, 293, 'ACP_STYLE_MANAGEMENT', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (63, 1, '', 'acp', 1, 50, 304, 311, 'ACP_FORUM_LOGS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (64, 1, '', 'acp', 1, 50, 312, 313, 'ACP_CAT_DATABASE', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (65, 1, '', 'acp', 1, 51, 316, 317, 'ACP_AUTOMATION', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (66, 1, '', 'acp', 1, 51, 318, 325, 'ACP_GENERAL_TASKS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (67, 1, '', 'acp', 1, 51, 326, 333, 'ACP_MODULE_MANAGEMENT', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (69, 1, 'modules', 'acp', 1, 67, 329, 330, 'UCP', 'ucp', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (71, 1, 'board', 'acp', 1, 42, 173, 174, 'ACP_BOARD_SETTINGS', 'settings', 'acl_a_board'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (72, 1, 'board', 'acp', 1, 42, 175, 176, 'ACP_BOARD_DEFAULTS', 'default', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (73, 1, 'board', 'acp', 1, 42, 177, 178, 'ACP_AVATAR_SETTINGS', 'avatar', 'acl_a_board'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (74, 1, 'attachments', 'acp', 1, 42, 179, 180, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (75, 1, '', 'acp', 1, 47, 216, 227, 'ACP_MESSAGES', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (76, 1, 'attachments', 'acp', 1, 56, 229, 230, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (77, 1, 'attachments', 'acp', 1, 56, 231, 232, 'ACP_EXTENSION_GROUPS', 'ext_groups', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (78, 1, 'attachments', 'acp', 1, 56, 233, 234, 'ACP_MANAGE_EXTENSIONS', 'extensions', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (80, 1, 'attachments', 'acp', 1, 56, 235, 236, 'ACP_ORPHAN_ATTACHMENTS', 'orphan', 'acl_a_attach'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 181, 182, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (82, 1, 'board', 'acp', 1, 43, 185, 186, 'ACP_AUTH_SETTINGS', 'auth', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (83, 1, 'board', 'acp', 1, 43, 187, 188, 'ACP_EMAIL_SETTINGS', 'email', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (84, 1, 'jabber', 'acp', 1, 43, 189, 190, 'ACP_JABBER_SETTINGS', 'settings', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 193, 194, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_cookies'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (86, 1, 'board', 'acp', 1, 44, 195, 196, 'ACP_SERVER_SETTINGS', 'server', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (87, 1, 'board', 'acp', 1, 44, 197, 198, 'ACP_LOAD_SETTINGS', 'load', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (89, 1, 'php_info', 'acp', 1, 44, 199, 200, 'ACP_PHP_INFO', 'info', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (91, 1, 'bots', 'acp', 1, 44, 201, 202, 'ACP_BOTS', 'bots', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (92, 1, 'modules', 'acp', 1, 67, 331, 332, 'MCP', 'mcp', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 217, 218, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (94, 1, 'bbcodes', 'acp', 1, 75, 219, 220, 'ACP_BBCODES', 'bbcodes', 'acl_a_bbcode'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (95, 1, 'icons', 'acp', 1, 75, 221, 222, 'ACP_ICONS', 'icons', 'acl_a_icons'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (96, 1, 'icons', 'acp', 1, 75, 223, 224, 'ACP_SMILIES', 'smilies', 'acl_a_icons'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (97, 1, 'words', 'acp', 1, 75, 225, 226, 'ACP_WORDS', 'words', 'acl_a_words'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (98, 1, 'logs', 'acp', 1, 63, 305, 306, 'ACP_ADMIN_LOGS', 'admin', 'acl_a_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (99, 1, 'logs', 'acp', 1, 63, 307, 308, 'ACP_MOD_LOGS', 'mod', 'acl_a_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (100, 1, 'logs', 'acp', 1, 63, 309, 310, 'ACP_CRITICAL_LOGS', 'critical', 'acl_a_'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (101, 1, 'language', 'acp', 1, 66, 319, 320, 'ACP_LANGUAGE_PACKS', 'lang_packs', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (102, 1, 'bots', 'acp', 1, 66, 321, 322, 'ACP_BOTS', 'bots', 'acl_a_server'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (103, 1, 'groups', 'acp', 1, 58, 267, 268, 'ACP_GROUPS_MANAGE', 'manage', 'acl_a_group'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (105, 1, 'email', 'acp', 1, 66, 323, 324, 'ACP_MASS_EMAIL', 'email', 'acl_a_email'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (106, 1, 'ranks', 'acp', 1, 57, 245, 246, 'ACP_MANAGE_RANKS', 'ranks', 'acl_a_ranks'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (107, 1, 'ban', 'acp', 1, 59, 275, 276, 'ACP_BAN_EMAILS', 'email', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (108, 1, 'ban', 'acp', 1, 59, 277, 278, 'ACP_BAN_IPS', 'ip', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (109, 1, 'ban', 'acp', 1, 59, 279, 280, 'ACP_BAN_USERNAMES', 'user', 'acl_a_ban'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (110, 1, 'disallow', 'acp', 1, 59, 273, 274, 'ACP_DISALLOW_USERNAMES', 'usernames', 'acl_a_names'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (111, 1, 'prune', 'acp', 1, 59, 271, 272, 'ACP_PRUNE_USERS', 'users', 'acl_a_userdel'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (112, 1, 'prune', 'acp', 1, 53, 209, 210, 'ACP_PRUNE_FORUMS', 'forums', 'acl_a_prune'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (113, 1, 'profile', 'acp', 1, 57, 243, 244, 'ACP_CUSTOM_PROFILE_FIELDS', 'profile', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (114, 1, 'forums', 'acp', 1, 53, 207, 208, 'ACP_MANAGE_FORUMS', 'manage', 'acl_a_forum'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (115, 1, 'users', 'acp', 1, 57, 241, 242, 'ACP_MANAGE_USERS', 'overview', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (116, 1, 'users', 'acp', 0, 57, 247, 248, 'ACP_USER_FEEDBACK', 'feedback', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (117, 1, 'users', 'acp', 0, 57, 249, 250, 'ACP_USER_PROFILE', 'profile', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (118, 1, 'users', 'acp', 0, 57, 251, 252, 'ACP_USER_PREFS', 'prefs', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (119, 1, 'users', 'acp', 0, 57, 253, 254, 'ACP_USER_AVATAR', 'avatar', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (120, 1, 'users', 'acp', 0, 57, 257, 258, 'ACP_USER_SIG', 'sig', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (121, 1, 'users', 'acp', 0, 57, 259, 260, 'ACP_USER_GROUPS', 'groups', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (122, 1, 'users', 'acp', 0, 57, 261, 262, 'ACP_USER_PERM', 'perm', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (123, 1, 'users', 'acp', 0, 57, 263, 264, 'ACP_USER_ATTACH', 'attach', 'acl_a_user'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (141, 1, '', 'acp', 1, 49, 294, 301, 'ACP_STYLE_COMPONENTS', '', ''); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (142, 1, 'styles', 'acp', 1, 62, 291, 292, 'ACP_STYLES', 'style', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (143, 1, 'styles', 'acp', 1, 141, 295, 296, 'ACP_TEMPLATES', 'template', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (144, 1, 'styles', 'acp', 1, 141, 297, 298, 'ACP_THEMES', 'theme', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (145, 1, 'styles', 'acp', 1, 141, 299, 300, 'ACP_IMAGESETS', 'imageset', 'acl_a_styles'); -INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (147, 1, 'users', 'acp', 0, 57, 255, 256, 'ACP_USER_RANK', 'rank', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (2, 1, '', 'acp', 1, 0, 197, 232, 'ACP_CAT_GENERAL', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (7, 1, 'modules', 'acp', 1, 67, 383, 384, 'ACP', 'acp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (11, 1, '', 'acp', 1, 0, 267, 310, 'ACP_CAT_USERGROUP', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (41, 1, 'main', 'acp', 1, 2, 198, 199, 'ACP_MAIN', 'main', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (42, 1, '', 'acp', 1, 2, 200, 211, 'ACP_GENERAL_CONFIGURATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (43, 1, '', 'acp', 1, 2, 212, 219, 'ACP_CLIENT_COMMUNICATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (44, 1, '', 'acp', 1, 2, 220, 231, 'ACP_SERVER_CONFIGURATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (46, 1, '', 'acp', 1, 0, 233, 242, 'ACP_CAT_FORUMS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (47, 1, '', 'acp', 1, 0, 243, 266, 'ACP_CAT_POSTING', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (48, 1, '', 'acp', 1, 0, 311, 344, 'ACP_CAT_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (49, 1, '', 'acp', 1, 0, 345, 358, 'ACP_CAT_STYLES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (50, 1, '', 'acp', 1, 0, 359, 370, 'ACP_CAT_MAINTANENCE', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (51, 1, '', 'acp', 1, 0, 371, 390, 'ACP_CAT_SYSTEM', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (52, 1, '', 'acp', 1, 0, 391, 392, 'ACP_CAT_DOT_MODS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (53, 1, '', 'acp', 1, 46, 234, 239, 'ACP_CAT_FORUMS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (54, 1, '', 'acp', 1, 46, 240, 241, 'ACP_CAT_PERMISSIONS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (56, 1, '', 'acp', 1, 47, 256, 265, 'ACP_ATTACHMENTS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (57, 1, '', 'acp', 1, 11, 268, 293, 'ACP_CAT_USERS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (58, 1, '', 'acp', 1, 11, 294, 297, 'ACP_GROUPS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (59, 1, '', 'acp', 1, 11, 298, 309, 'ACP_USER_SECURITY', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (61, 1, '', 'acp', 1, 48, 312, 329, 'ACP_PERMISSION_SETTINGS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (62, 1, '', 'acp', 1, 49, 346, 349, 'ACP_STYLE_MANAGEMENT', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (63, 1, '', 'acp', 1, 50, 360, 367, 'ACP_FORUM_LOGS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (64, 1, '', 'acp', 1, 50, 368, 369, 'ACP_CAT_DATABASE', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (65, 1, '', 'acp', 1, 51, 372, 373, 'ACP_AUTOMATION', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (66, 1, '', 'acp', 1, 51, 374, 381, 'ACP_GENERAL_TASKS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (67, 1, '', 'acp', 1, 51, 382, 389, 'ACP_MODULE_MANAGEMENT', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (69, 1, 'modules', 'acp', 1, 67, 385, 386, 'UCP', 'ucp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (71, 1, 'board', 'acp', 1, 42, 201, 202, 'ACP_BOARD_SETTINGS', 'settings', 'acl_a_board'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (72, 1, 'board', 'acp', 1, 42, 203, 204, 'ACP_BOARD_DEFAULTS', 'default', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (73, 1, 'board', 'acp', 1, 42, 205, 206, 'ACP_AVATAR_SETTINGS', 'avatar', 'acl_a_board'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (74, 1, 'attachments', 'acp', 1, 42, 207, 208, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (75, 1, '', 'acp', 1, 47, 244, 255, 'ACP_MESSAGES', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (76, 1, 'attachments', 'acp', 1, 56, 257, 258, 'ACP_ATTACHMENT_SETTINGS', 'attach', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (77, 1, 'attachments', 'acp', 1, 56, 259, 260, 'ACP_EXTENSION_GROUPS', 'ext_groups', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (78, 1, 'attachments', 'acp', 1, 56, 261, 262, 'ACP_MANAGE_EXTENSIONS', 'extensions', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (80, 1, 'attachments', 'acp', 1, 56, 263, 264, 'ACP_ORPHAN_ATTACHMENTS', 'orphan', 'acl_a_attach'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (81, 1, 'board', 'acp', 1, 42, 209, 210, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (82, 1, 'board', 'acp', 1, 43, 213, 214, 'ACP_AUTH_SETTINGS', 'auth', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (83, 1, 'board', 'acp', 1, 43, 215, 216, 'ACP_EMAIL_SETTINGS', 'email', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (84, 1, 'jabber', 'acp', 1, 43, 217, 218, 'ACP_JABBER_SETTINGS', 'settings', 'acl_a_jabber'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (85, 1, 'board', 'acp', 1, 44, 221, 222, 'ACP_COOKIE_SETTINGS', 'cookie', 'acl_a_cookies'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (86, 1, 'board', 'acp', 1, 44, 223, 224, 'ACP_SERVER_SETTINGS', 'server', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (87, 1, 'board', 'acp', 1, 44, 225, 226, 'ACP_LOAD_SETTINGS', 'load', 'acl_a_server'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (89, 1, 'php_info', 'acp', 1, 44, 227, 228, 'ACP_PHP_INFO', 'info', 'acl_a_phpinfo'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (91, 1, 'bots', 'acp', 1, 44, 229, 230, 'ACP_BOTS', 'bots', 'acl_a_bots'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (92, 1, 'modules', 'acp', 1, 67, 387, 388, 'MCP', 'mcp', 'acl_a_modules'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (93, 1, 'board', 'acp', 1, 75, 245, 246, 'ACP_MESSAGE_SETTINGS', 'message', 'acl_a_defaults'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (94, 1, 'bbcodes', 'acp', 1, 75, 247, 248, 'ACP_BBCODES', 'bbcodes', 'acl_a_bbcode'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (95, 1, 'icons', 'acp', 1, 75, 249, 250, 'ACP_ICONS', 'icons', 'acl_a_icons'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (96, 1, 'icons', 'acp', 1, 75, 251, 252, 'ACP_SMILIES', 'smilies', 'acl_a_icons'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (97, 1, 'words', 'acp', 1, 75, 253, 254, 'ACP_WORDS', 'words', 'acl_a_words'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (98, 1, 'logs', 'acp', 1, 63, 361, 362, 'ACP_ADMIN_LOGS', 'admin', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (99, 1, 'logs', 'acp', 1, 63, 363, 364, 'ACP_MOD_LOGS', 'mod', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (100, 1, 'logs', 'acp', 1, 63, 365, 366, 'ACP_CRITICAL_LOGS', 'critical', 'acl_a_viewlogs'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (101, 1, 'language', 'acp', 1, 66, 375, 376, 'ACP_LANGUAGE_PACKS', 'lang_packs', 'acl_a_language'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (102, 1, 'bots', 'acp', 1, 66, 377, 378, 'ACP_BOTS', 'bots', 'acl_a_bots'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (103, 1, 'groups', 'acp', 1, 58, 295, 296, 'ACP_GROUPS_MANAGE', 'manage', 'acl_a_group'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (105, 1, 'email', 'acp', 1, 66, 379, 380, 'ACP_MASS_EMAIL', 'email', 'acl_a_email'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (106, 1, 'ranks', 'acp', 1, 57, 273, 274, 'ACP_MANAGE_RANKS', 'ranks', 'acl_a_ranks'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (107, 1, 'ban', 'acp', 1, 59, 303, 304, 'ACP_BAN_EMAILS', 'email', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (108, 1, 'ban', 'acp', 1, 59, 305, 306, 'ACP_BAN_IPS', 'ip', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (109, 1, 'ban', 'acp', 1, 59, 307, 308, 'ACP_BAN_USERNAMES', 'user', 'acl_a_ban'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (110, 1, 'disallow', 'acp', 1, 59, 301, 302, 'ACP_DISALLOW_USERNAMES', 'usernames', 'acl_a_names'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (111, 1, 'prune', 'acp', 1, 59, 299, 300, 'ACP_PRUNE_USERS', 'users', 'acl_a_userdel'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (112, 1, 'prune', 'acp', 1, 53, 237, 238, 'ACP_PRUNE_FORUMS', 'forums', 'acl_a_prune'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (113, 1, 'profile', 'acp', 1, 57, 271, 272, 'ACP_CUSTOM_PROFILE_FIELDS', 'profile', 'acl_a_profile'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (114, 1, 'forums', 'acp', 1, 53, 235, 236, 'ACP_MANAGE_FORUMS', 'manage', 'acl_a_forum'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (115, 1, 'users', 'acp', 1, 57, 269, 270, 'ACP_MANAGE_USERS', 'overview', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (116, 1, 'users', 'acp', 0, 57, 275, 276, 'ACP_USER_FEEDBACK', 'feedback', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (117, 1, 'users', 'acp', 0, 57, 277, 278, 'ACP_USER_PROFILE', 'profile', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (118, 1, 'users', 'acp', 0, 57, 279, 280, 'ACP_USER_PREFS', 'prefs', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (119, 1, 'users', 'acp', 0, 57, 281, 282, 'ACP_USER_AVATAR', 'avatar', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (120, 1, 'users', 'acp', 0, 57, 285, 286, 'ACP_USER_SIG', 'sig', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (121, 1, 'users', 'acp', 0, 57, 287, 288, 'ACP_USER_GROUPS', 'groups', 'acl_a_user && acl_a_group'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (122, 1, 'users', 'acp', 0, 57, 289, 290, 'ACP_USER_PERM', 'perm', 'acl_a_user && acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (123, 1, 'users', 'acp', 0, 57, 291, 292, 'ACP_USER_ATTACH', 'attach', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (141, 1, '', 'acp', 1, 49, 350, 357, 'ACP_STYLE_COMPONENTS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (142, 1, 'styles', 'acp', 1, 62, 347, 348, 'ACP_STYLES', 'style', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (143, 1, 'styles', 'acp', 1, 141, 351, 352, 'ACP_TEMPLATES', 'template', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (144, 1, 'styles', 'acp', 1, 141, 353, 354, 'ACP_THEMES', 'theme', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (145, 1, 'styles', 'acp', 1, 141, 355, 356, 'ACP_IMAGESETS', 'imageset', 'acl_a_styles'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (147, 1, 'users', 'acp', 0, 57, 283, 284, 'ACP_USER_RANK', 'rank', 'acl_a_user'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (148, 1, 'permissions', 'acp', 1, 61, 313, 314, 'ACP_USERS_PERMISSIONS', 'setting_user_global', 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (149, 1, 'permissions', 'acp', 1, 61, 315, 316, 'ACP_USERS_FORUM_PERMISSIONS', 'setting_user_local', 'acl_a_authusers && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (150, 1, 'permissions', 'acp', 1, 61, 317, 318, 'ACP_GROUPS_PERMISSIONS', 'setting_group_global', 'acl_a_authgroups && (acl_a_aauth || acl_a_mauth || acl_a_uauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (151, 1, 'permissions', 'acp', 1, 61, 319, 320, 'ACP_GROUPS_FORUM_PERMISSIONS', 'setting_group_local', 'acl_a_authgroups && (acl_a_mauth || acl_a_fauth)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (152, 1, 'permissions', 'acp', 1, 61, 321, 322, 'ACP_ADMINISTRATORS', 'setting_admin_global', 'acl_a_aauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (155, 1, 'permissions', 'acp', 1, 61, 323, 324, 'ACP_GLOBAL_MODERATORS', 'setting_mod_global', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (156, 1, 'permissions', 'acp', 1, 61, 325, 326, 'ACP_FORUM_MODERATORS', 'setting_mod_local', 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (157, 1, 'permissions', 'acp', 1, 61, 327, 328, 'ACP_FORUM_PERMISSIONS', 'setting_forum_local', 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (158, 1, '', 'acp', 1, 48, 330, 341, 'ACP_PERMISSION_MASKS', '', ''); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (159, 1, 'permissions', 'acp', 1, 158, 331, 332, 'ACP_VIEW_ADMIN_PERMISSIONS', 'view_admin_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (160, 1, 'permissions', 'acp', 1, 158, 333, 334, 'ACP_VIEW_USER_PERMISSIONS', 'view_user_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (161, 1, 'permissions', 'acp', 1, 158, 335, 336, 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS', 'view_mod_global', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (162, 1, 'permissions', 'acp', 1, 158, 337, 338, 'ACP_VIEW_FORUM_MOD_PERMISSIONS', 'view_mod_local', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (163, 1, 'permissions', 'acp', 1, 158, 339, 340, 'ACP_VIEW_FORUM_PERMISSIONS', 'view_forum_local', 'acl_a_viewauth'); +INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (165, 1, '', 'acp', 1, 48, 342, 343, 'Permission Presets', '', ''); # MCP INSERT INTO phpbb_modules (module_id, module_enabled, module_name, module_class, module_display, parent_id, left_id, right_id, module_langname, module_mode, module_auth) VALUES (124, 1, '', 'mcp', 1, 0, 35, 44, 'MCP_MAIN', '', ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index ee61fa6be0..e4339d8a64 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -35,7 +35,8 @@ CREATE INDEX filesize_phpbb_attachments on phpbb_attachments (filesize); CREATE TABLE phpbb_auth_groups ( group_id mediumint(8) NOT NULL DEFAULT '0', forum_id mediumint(8) NOT NULL DEFAULT '0', - auth_option_id smallint(5) NOT NULL DEFAULT '0', + auth_option_id mediumint(8) NOT NULL DEFAULT '0', + auth_preset_id mediumint(8) NOT NULL DEFAULT '0', auth_setting tinyint(4) NOT NULL DEFAULT '0' ); @@ -57,18 +58,26 @@ CREATE INDEX auth_option_phpbb_auth_options on phpbb_auth_options (auth_option); CREATE TABLE phpbb_auth_presets ( preset_id INTEGER PRIMARY KEY NOT NULL, preset_name varchar(50) NOT NULL DEFAULT '', - preset_user_id mediumint(5) NOT NULL DEFAULT '0', - preset_type varchar(2) NOT NULL DEFAULT '', - preset_data text(65535) NOT NULL DEFAULT '' + preset_type varchar(10) NOT NULL DEFAULT '', + preset_group_id mediumint(8) NOT NULL DEFAULT '0' ); CREATE INDEX preset_type_phpbb_auth_presets on phpbb_auth_presets (preset_type); +# Table: phpbb_auth_preset_data +CREATE TABLE phpbb_auth_preset_data ( + preset_id mediumint(8) NOT NULL DEFAULT '0', + auth_option_id mediumint(8) NOT NULL DEFAULT '0', + auth_setting tinyint(2) NOT NULL DEFAULT '0', + PRIMARY KEY (preset_id, auth_option_id) +); + # Table: phpbb_auth_users CREATE TABLE phpbb_auth_users ( user_id mediumint(8) NOT NULL DEFAULT '0', forum_id mediumint(8) NOT NULL DEFAULT '0', - auth_option_id smallint(5) NOT NULL DEFAULT '0', + auth_option_id mediumint(8) NOT NULL DEFAULT '0', + auth_preset_id mediumint(8) NOT NULL DEFAULT '0', auth_setting tinyint(4) NOT NULL DEFAULT '0' ); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index a9ba62d0f3..e22559e8cb 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -112,6 +112,10 @@ $lang = array_merge($lang, array( 'ACP_PERMISSION_MASKS' => 'Permission Masks', 'ACP_PERMISSION_SETTINGS' => 'Permission Settings', 'ACP_PHP_INFO' => 'PHP Information', + 'ACP_PRESET_ADMIN' => 'Admin Permission Presets', + 'ACP_PRESET_FORUM' => 'Forum Permission Presets', + 'ACP_PRESET_MOD' => 'Mod Permission Presets', + 'ACP_PRESET_USER' => 'User Permission Presets', 'ACP_PRUNE_FORUMS' => 'Prune Forums', 'ACP_PRUNE_USERS' => 'Prune Users', 'ACP_PRUNING' => 'Pruning', @@ -212,6 +216,7 @@ $lang = array_merge($lang, array( 'REORDER' => 'Reorder', 'RETURN_TO' => 'Return to ...', + 'SELECT_ANONYMOUS' => 'Select Anonymous User', 'SELECT_OPTION' => 'Select option', 'UCP' => 'User Control Panel', @@ -421,6 +426,9 @@ $lang = array_merge($lang, array( 'LOG_MODULE_ADD' => '<b>Module added</b><br />» %s', 'LOG_MODULE_EDIT' => '<b>Module edited</b><br />» %s', + 'LOG_PRESET_ADD' => '<b>Preset added</b><br />» %s', + 'LOG_PRESET_EDIT' => '<b>Preset edited</b><br />» %s', + 'LOG_PROFILE_FIELD_ACTIVATE' => '<b>Profile field activated</b><br />» %s', 'LOG_PROFILE_FIELD_CREATE' => '<b>Profile field added</b><br />» %s', 'LOG_PROFILE_FIELD_DEACTIVATE' => '<b>Profile field deactivated</b><br />» %s', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php new file mode 100644 index 0000000000..9e1cbed806 --- /dev/null +++ b/phpBB/language/en/acp/permissions.php @@ -0,0 +1,127 @@ +<?php +/** +* +* acp_permissions [English] +* +* @package language +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* DO NOT CHANGE +*/ +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine + +$lang = array_merge($lang, array( + 'ACL_NO' => 'No', + 'ACL_SET' => 'Setting Permissions', + 'ACL_SET_EXPLAIN' => 'Permissions are based on a simple YES/NO system. Setting an option to NO for a user or usergroup overrides any other value assigned to it. If you do not wish to assign a value for an option for this user or group select UNSET. If values are assigned for this option elsewhere they will be used in preference, else NO is assumed. All objects marked (with the checkbox in front of them) will inherit the permission set you defined.', + 'ACL_SETTING' => 'Setting', + + 'ACL_TYPE_A_' => 'Administrative Permissions', + 'ACL_TYPE_F_' => 'Forum Permissions', + 'ACL_TYPE_M_' => 'Moderative Permissions', + 'ACL_TYPE_U_' => 'User Permissions', + + 'ACL_TYPE_GLOBAL_A_' => 'Administrative Permissions', + 'ACL_TYPE_GLOBAL_U_' => 'User Permissions', + 'ACL_TYPE_GLOBAL_M_' => 'Global Moderator Permissions', + 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator Permissions', + 'ACL_TYPE_LOCAL_F_' => 'Forum Permissions', + + 'ACL_UNSET' => 'Unset', + 'ACL_VIEW' => 'Viewing Permissions', + 'ACL_VIEW_EXPLAIN' => 'Here you can see the effective permissions the user/group is having. A red square indicates that the user/group does not have the permission, a green square indicates that the user/group does have the permission.', + 'ACL_YES' => 'Yes', + + 'ACP_ADMINISTRATORS_EXPLAIN' => 'Here you can assign administrator rights to users or groups. All users with admin permissions can view the administration panel.', + 'ACP_FORUM_MODERATORS_EXPLAIN' => 'Here you can assign users and groups as forum moderators. To assign users access to forums, to define global moderative rights or administrators please use the appropriate page.', + 'ACP_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can alter which users and groups can access which forums. To assign moderators or define administrators please use the appropriate page.', + 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator rights to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', + 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', + 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and admin permissions. User permissions include capabilities such as the use of avatars, sending private messages, etc. Global moderator permissions are blabla, administrative permissions blabla. Individual users permissions should only be changed in rare occassions, the preferred method is putting users in groups and assigning the groups permissions.', + 'ACP_PRESET_ADMIN_EXPLAIN' => 'Here you are able to manage the presets for administrative permissions. Presets are effective permissions, if you change a preset the items having this preset assigned will change it\'s permissions too.', + 'ACP_PRESET_FORUM_EXPLAIN' => 'Here you are able to manage the presets for forum permissions. Presets are effective permissions, if you change a preset the items having this preset assigned will change it\'s permissions too.', + 'ACP_PRESET_MOD_EXPLAIN' => 'Here you are able to manage the presets for moderative permissions. Presets are effective permissions, if you change a preset the items having this preset assigned will change it\'s permissions too.', + 'ACP_PRESET_USER_EXPLAIN' => 'Here you are able to manage the presets for user permissions. Presets are effective permissions, if you change a preset the items having this preset assigned will change it\'s permissions too.', + 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', + 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and admin permissions. User permissions include capabilities such as the use of avatars, sending private messages, etc. Global moderator permissions are blabla, administrative permissions blabla. To alter these settings for large numbers of users the Group permissions system is the prefered method. Users permissions should only be changed in rare occassions, the preferred method is putting users in groups and assigning the groups permissions.', + 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups', + 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups', + 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums', + 'ACP_VIEW_FORUM_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the forum moderator permissions assigned to the selected users/groups and forums', + 'ACP_VIEW_USER_PERMISSIONS_EXPLAIN' => 'Here you can view the effective user permissions assigned to the selected users/groups', + + 'ADD_GROUPS' => 'Add Groups', + 'ADD_USERS' => 'Add Users', + 'ALL_NO' => 'All No', + 'ALL_UNSET' => 'All Unset', + 'ALL_YES' => 'All Yes', + 'APPLY_ALL_PERMISSIONS' => 'Apply all Permissions', + 'APPLY_PERMISSIONS' => 'Apply Permissions', + 'APPLY_PERMISSIONS_EXPLAIN' => 'The Permissions and Preset defined for this item will only be applied to this item and all checked items.', + 'AUTH_UPDATED' => 'Permissions have been updated', + + 'CREATE_PRESET' => 'Create Preset', + 'CREATE_PRESET_FROM' => 'Use settings from...', + + 'EDIT_PRESET' => 'Edit Preset', + 'EVERY_USER_GROUP' => 'Every user/group', + + 'GROUP_BINDING' => 'Group Binding', + 'GROUP_BINDING_EXPLAIN' => 'If a group is selected here the preset only shows up for the selected group. This is helpful if you set options only meant for administrators for example.', + + 'LOOK_UP_FORUMS_EXPLAIN' => 'You are able to select more than one forum', + 'LOOK_UP_GROUP' => 'Look up Usergroup', + 'LOOK_UP_USER' => 'Look up User', + + 'MANAGE_GROUPS' => 'Manage Groups', + 'MANAGE_USERS' => 'Manage Users', + + 'NO_AUTH_SETTING_FOUND' => 'Permission settings not defined.', + 'NO_PRESET_NAME_SPECIFIED' => 'Please give the preset a name.', + 'NO_PRESET_SELECTED' => 'Preset could not be found.', + + 'ONLY_FORUM_DEFINED' => 'You only defined forums in your selection. Please also select at least one user or one group.', + + 'PERM_PRESET_APPLIED_TO_ALL' => 'Permissions and Preset will also be applied to all checked objects', + 'PRESET' => 'Preset', + 'PRESET_ADD_SUCCESS' => 'Preset successfully added.', + 'PRESET_DETAILS' => 'Preset Details', + 'PRESET_EDIT_SUCCESS' => 'Preset successfully edited.', + 'PRESET_NAME' => 'Preset Name', + 'PRESET_NAME_ALREADY_EXIST' => 'A preset named <strong>%s</strong> already exist for the specified settings.', + + 'SELECTED_FORUM_NOT_EXIST' => 'The selected forum(s) do not exist', + 'SELECTED_GROUP_NOT_EXIST' => 'The selected group(s) do not exist', + 'SELECTED_USER_NOT_EXIST' => 'The selected user(s) do not exist', + 'SELECT_TYPE' => 'Select type', + 'SET_PERMISSIONS' => 'Set permissions', + 'SET_USERS_PERMISSIONS' => 'Set users permissions', + 'SET_USERS_FORUM_PERMISSIONS' => 'Set users forum permissions', + + 'USER_IS_MEMBER_OF_DEFAULT' => 'is a member of the following default groups', + 'USER_IS_MEMBER_OF_CUSTOM' => 'is a member of the following custom groups', + + 'VIEW_PERMISSIONS' => 'View permissions', + + 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected', +)); + +?>
\ No newline at end of file diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php new file mode 100644 index 0000000000..1083dfe71f --- /dev/null +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -0,0 +1,222 @@ +<?php +/** +* +* acp_permissions (phpBB Permission Set) [English] +* +* @package language +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* DO NOT CHANGE +*/ +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +// DEVELOPERS PLEASE NOTE +// +// Placeholders can now contain order information, e.g. instead of +// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows +// translators to re-order the output of data while ensuring it remains correct +// +// You do not need this where single placeholders are used, e.g. 'Message %d' is fine +// equally where a string contains only two placeholders which are used to wrap text +// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine + +/* + MODDERS PLEASE NOTE + + Please add your permission settings this way: + + // Adding new category + $lang['permission_cats']['bugs'] = 'Bugs'; + + // Adding new permission set + $lang['permission_sets']['bug_'] = 'Bug Permissions'; + + // Adding the permissions + $lang = array_merge($lang, array( + 'acl_bug_view' => array('lang' => 'Can view bug reports', 'cat' => 'bugs'), + 'acl_bug_post' => array('lang' => 'Can post bugs', 'cat' => 'post'), // Using a phpBB category here + )); + + TODO: + You are able to put your permission sets into a seperate file too by + prefixing it with permissions_ and putting it into the acp language folder. +*/ + +// Define categories and permission types +$lang = array_merge($lang, array( + 'permission_cat' => array( + 'actions' => 'Actions', + 'forums' => 'Forums', + 'post' => 'Post', + 'posting' => 'Posting', + 'polls' => 'Polls', + 'content' => 'Content', + 'pm' => 'Private Messages', + 'misc' => 'Misc', + 'profile' => 'Profile', + 'permissions' => 'Permissions', + 'settings' => 'Settings', + 'user_group' => 'Users & Groups', + ), + + 'permission_type' => array( + 'u_' => 'User Permissions', + 'a_' => 'Admin Permissions', + 'm_' => 'Moderator Permissions', + 'f_' => 'Forum Permissions', + ), +)); + +// User Permissions +$lang = array_merge($lang, array( + 'acl_u_viewprofile' => array('lang' => 'Can view profiles', 'cat' => 'profile'), + 'acl_u_chgname' => array('lang' => 'Can change username', 'cat' => 'profile'), + 'acl_u_chgpasswd' => array('lang' => 'Can change password', 'cat' => 'profile'), + 'acl_u_chgemail' => array('lang' => 'Can change email address', 'cat' => 'profile'), + 'acl_u_chgavatar' => array('lang' => 'Can change avatar', 'cat' => 'profile'), + 'acl_u_chggrp' => array('lang' => 'Can change default usergroup', 'cat' => 'profile'), + + 'acl_u_attach' => array('lang' => 'Can attach files', 'cat' => 'post'), + 'acl_u_download' => array('lang' => 'Can download files', 'cat' => 'post'), + 'acl_u_savedrafts' => array('lang' => 'Can save drafts', 'cat' => 'post'), + 'acl_u_chgcensors' => array('lang' => 'Can disable word censors', 'cat' => 'post'), + 'acl_u_sig' => array('lang' => 'Can use signature', 'cat' => 'post'), + + 'acl_u_sendpm' => array('lang' => 'Can send private messages', 'cat' => 'pm'), + 'acl_u_readpm' => array('lang' => 'Can read private messages', 'cat' => 'pm'), + 'acl_u_pm_edit' => array('lang' => 'Can edit own private messages', 'cat' => 'pm'), + 'acl_u_pm_delete' => array('lang' => 'Can remove private messages from own folder', 'cat' => 'pm'), + 'acl_u_pm_report' => array('lang' => 'Can report private messages', 'cat' => 'pm'), + 'acl_u_pm_forward' => array('lang' => 'Can forward private messages', 'cat' => 'pm'), + 'acl_u_pm_emailpm' => array('lang' => 'Can email private messages', 'cat' => 'pm'), + 'acl_u_pm_printpm' => array('lang' => 'Can print private messages', 'cat' => 'pm'), + 'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'), + 'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'), + 'acl_u_pm_bbcode' => array('lang' => 'Can post BBCode in private messages', 'cat' => 'pm'), + 'acl_u_pm_html' => array('lang' => 'Can post HTML in private messages', 'cat' => 'pm'), + 'acl_u_pm_smilies' => array('lang' => 'Can post smilies in private messages', 'cat' => 'pm'), + 'acl_u_pm_img' => array('lang' => 'Can post images in private messages', 'cat' => 'pm'), + 'acl_u_pm_flash' => array('lang' => 'Can post Flash in private messages', 'cat' => 'pm'), + + 'acl_u_sendemail' => array('lang' => 'Can send emails', 'cat' => 'misc'), + 'acl_u_sendim' => array('lang' => 'Can send instant messages', 'cat' => 'misc'), + 'acl_u_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'), + 'acl_u_hideonline' => array('lang' => 'Can hide online status', 'cat' => 'misc'), + 'acl_u_viewonline' => array('lang' => 'Can view all online', 'cat' => 'misc'), + 'acl_u_search' => array('lang' => 'Can search board', 'cat' => 'misc'), +)); + +// Forum Permissions +$lang = array_merge($lang, array( + 'acl_f_list' => array('lang' => 'Can see forum', 'cat' => 'post'), + 'acl_f_read' => array('lang' => 'Can read forum', 'cat' => 'post'), + 'acl_f_post' => array('lang' => 'Can post in forum', 'cat' => 'post'), + 'acl_f_announce' => array('lang' => 'Can post announcements', 'cat' => 'post'), + 'acl_f_sticky' => array('lang' => 'Can post stickies', 'cat' => 'post'), + 'acl_f_reply' => array('lang' => 'Can reply to posts', 'cat' => 'post'), + 'acl_f_quote' => array('lang' => 'Can quote posts', 'cat' => 'post'), + 'acl_f_icons' => array('lang' => 'Can use post icons', 'cat' => 'post'), + + 'acl_f_poll' => array('lang' => 'Can create polls', 'cat' => 'polls'), + 'acl_f_vote' => array('lang' => 'Can vote in polls', 'cat' => 'polls'), + 'acl_f_votechg' => array('lang' => 'Can change existing vote', 'cat' => 'polls'), + + 'acl_f_attach' => array('lang' => 'Can attach files', 'cat' => 'content'), + 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'content'), + 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'), + 'acl_f_html' => array('lang' => 'Can post HTML', 'cat' => 'content'), + 'acl_f_bbcode' => array('lang' => 'Can post BBCode', 'cat' => 'content'), + 'acl_f_smilies' => array('lang' => 'Can post smilies', 'cat' => 'content'), + 'acl_f_img' => array('lang' => 'Can post images', 'cat' => 'content'), + 'acl_f_flash' => array('lang' => 'Can post Flash', 'cat' => 'content'), + + 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'actions'), + 'acl_f_delete' => array('lang' => 'Can delete own posts', 'cat' => 'actions'), + 'acl_f_user_lock' => array('lang' => 'Can lock own topics', 'cat' => 'actions'), + 'acl_f_bump' => array('lang' => 'Can bump topics', 'cat' => 'actions'), + 'acl_f_rate' => array('lang' => 'Can rate posts', 'cat' => 'actions'), + 'acl_f_report' => array('lang' => 'Can report posts', 'cat' => 'actions'), + 'acl_f_subscribe' => array('lang' => 'Can subscribe forum', 'cat' => 'actions'), + 'acl_f_print' => array('lang' => 'Can print topics', 'cat' => 'actions'), + 'acl_f_email' => array('lang' => 'Can email topics', 'cat' => 'actions'), + + 'acl_f_search' => array('lang' => 'Can search the forum', 'cat' => 'misc'), + 'acl_f_ignoreflood' => array('lang' => 'Can ignore flood limit', 'cat' => 'misc'), + 'acl_f_postcount' => array('lang' => 'Increment post counter', 'cat' => 'misc'), + 'acl_f_moderate' => array('lang' => 'Posts are moderated', 'cat' => 'misc'), +)); + +// Moderator Permissions +$lang = array_merge($lang, array( + 'acl_m_edit' => array('lang' => 'Can edit posts', 'cat' => 'actions'), + 'acl_m_delete' => array('lang' => 'Can delete posts', 'cat' => 'actions'), + 'acl_m_move' => array('lang' => 'Can move topics', 'cat' => 'actions'), + 'acl_m_lock' => array('lang' => 'Can lock topics', 'cat' => 'actions'), + 'acl_m_split' => array('lang' => 'Can split topics', 'cat' => 'actions'), + 'acl_m_merge' => array('lang' => 'Can merge topics', 'cat' => 'actions'), + 'acl_m_approve' => array('lang' => 'Can approve posts', 'cat' => 'actions'), + 'acl_m_unrate' => array('lang' => 'Can un-rate posts', 'cat' => 'actions'), + + 'acl_m_auth' => array('lang' => 'Can set permissions', 'cat' => 'misc'), + 'acl_m_ip' => array('lang' => 'Can view IP\'s', 'cat' => 'misc'), + 'acl_m_info' => array('lang' => 'Can alter forum info', 'cat' => 'misc'), +)); + +// Admin Permissions +$lang = array_merge($lang, array( + 'acl_a_defaults' => array('lang' => 'Can alter board defaults', 'cat' => 'settings'), + 'acl_a_board' => array('lang' => 'Can alter board settings', 'cat' => 'settings'), + 'acl_a_cookies' => array('lang' => 'Can alter cookie settings', 'cat' => 'settings'), + 'acl_a_server' => array('lang' => 'Can alter server/email/load/auth settings', 'cat' => 'settings'), + 'acl_a_jabber' => array('lang' => 'Can alter jabber settings', 'cat' => 'settings'), + 'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'), + + 'acl_a_forum' => array('lang' => 'Can manage forums', 'cat' => 'forums'), + 'acl_a_forumadd' => array('lang' => 'Can add new forums', 'cat' => 'forums'), + 'acl_a_forumdel' => array('lang' => 'Can delete forums', 'cat' => 'forums'), + 'acl_a_prune' => array('lang' => 'Can prune forums', 'cat' => 'forums'), + + 'acl_a_icons' => array('lang' => 'Can alter topic icons and smilies', 'cat' => 'posting'), + 'acl_a_words' => array('lang' => 'Can alter word censors', 'cat' => 'posting'), + 'acl_a_bbcode' => array('lang' => 'Can define BBCode tags', 'cat' => 'posting'), + 'acl_a_attach' => array('lang' => 'Can alter attachment related settings', 'cat' => 'posting'), + + 'acl_a_user' => array('lang' => 'Can manage users', 'cat' => 'user_group'), + 'acl_a_userdel' => array('lang' => 'Can delete/prune users', 'cat' => 'user_group'), + 'acl_a_group' => array('lang' => 'Can manage groups', 'cat' => 'user_group'), + 'acl_a_groupadd' => array('lang' => 'Can add new groups', 'cat' => 'user_group'), + 'acl_a_groupdel' => array('lang' => 'Can delete groups', 'cat' => 'user_group'), + 'acl_a_ranks' => array('lang' => 'Can manage ranks', 'cat' => 'user_group'), + 'acl_a_profile' => array('lang' => 'Can manage custom profile fields', 'cat' => 'user_group'), + 'acl_a_names' => array('lang' => 'Can manage disallowed names', 'cat' => 'user_group'), + 'acl_a_ban' => array('lang' => 'Can manage bans', 'cat' => 'user_group'), + + 'acl_a_viewauth' => array('lang' => 'Can view permission masks', 'cat' => 'permissions'), + 'acl_a_fauth' => array('lang' => 'Can alter forum permissions', 'cat' => 'permissions'), + 'acl_a_mauth' => array('lang' => 'Can alter moderator permissions', 'cat' => 'permissions'), + 'acl_a_aauth' => array('lang' => 'Can alter admin permissions', 'cat' => 'permissions'), + 'acl_a_uauth' => array('lang' => 'Can alter user permissions', 'cat' => 'permissions'), + 'acl_a_authgroups' => array('lang' => 'Can alter permissions for groups', 'cat' => 'permissions'), + 'acl_a_authusers' => array('lang' => 'Can alter permissions for users', 'cat' => 'permissions'), + + 'acl_a_styles' => array('lang' => 'Can manage styles', 'cat' => 'misc'), + 'acl_a_viewlogs' => array('lang' => 'Can view logs', 'cat' => 'misc'), + 'acl_a_clearlogs' => array('lang' => 'Can clear logs', 'cat' => 'misc'), + 'acl_a_modules' => array('lang' => 'Can manage modules', 'cat' => 'misc'), + 'acl_a_language' => array('lang' => 'Can manage language packs', 'cat' => 'misc'), + 'acl_a_email' => array('lang' => 'Can send mass email', 'cat' => 'misc'), + 'acl_a_bots' => array('lang' => 'Can manage bots', 'cat' => 'misc'), +# 'acl_a_backup' => array('lang' => 'Can backup database', 'cat' => 'misc'), +# 'acl_a_restore' => array('lang' => 'Can restore database', 'cat' => 'misc'), +# 'acl_a_search' => array('lang' => 'Can re-index search tables', 'cat' => 'misc'), +)); + +?>
\ No newline at end of file diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 96db678f8a..fa6032b8dc 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -144,6 +144,7 @@ $lang = array_merge($lang, array( 'GO' => 'Go', 'GOTO_PAGE' => 'Goto page', 'GROUP' => 'Group', + 'GROUPS' => 'Groups', 'GROUP_ERR_DESC_LONG' => 'Group description too long.', 'GROUP_ERR_TYPE' => 'Inappropriate group type specified.', 'GROUP_ERR_USERNAME' => 'No group name specified.', |