PHP problem :(

Started by The_Asker, October 17, 2014, 06:03:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The_Asker

Hi.

I have no idea how to work with PHP and while installing packages I suddenly got an error when it redirected me to the permissions page, and there were no errors in the package.

Permission list:


$permissionList = array(
'membergroup' => array(
'downloads_view' => array(false, 'downloads', 'downloads'),
'downloads_add' => array(false, 'downloads', 'downloads'),
'downloads_edit' => array(false, 'downloads', 'downloads'),
'downloads_delete' => array(false, 'downloads', 'downloads'),
'downloads_ratefile' => array(false, 'downloads', 'downloads'),
'downloads_comment' => array(false, 'downloads', 'downloads'),
'downloads_editcomment' => array(false, 'downloads', 'downloads'),
'downloads_report' => array(false, 'downloads', 'downloads'),
'downloads_autocomment' => array(false, 'downloads', 'downloads'),
'downloads_autoapprove' => array(false, 'downloads', 'downloads'),
'downloads_manage' => array(false, 'downloads', 'downloads'),

'pc_can_comment' => array(false, 'profile_comments', 'profile_comments'),
'pc_can_modify' => array(true, 'profile_comments', 'profile_comments'),
'pc_can_delete' => array(true, 'profile_comments', 'profile_comments'),
'view_stafflist' => array(false, 'general', 'view_basic_info'),
'view_stats' => array(false, 'general', 'view_basic_info'),
'view_mlist' => array(false, 'general', 'view_basic_info'),
'search_posts' => array(false, 'general', 'view_basic_info'),
'view_ic' => array(false, 'icp', 'icp'),
'false', 'icp', 'icp'),
                        'karmalog_view' => array(false, 'general', 'view_basic_info'),
'CFOP_view' => array(false, 'general', 'view_basic_info'),

'karma_edit' => array(false, 'general', 'moderate_general'),
'pm_read' => array(false, 'pm', 'use_pm_system'),
'save_drafts' => array(false, 'drafts', 'drafts'),
'sp_admin' => array(false, 'sp', 'sp'),
'sp_manage_settings' => array(false, 'sp', 'sp'),
'sp_manage_blocks' => array(false, 'sp', 'sp'),
'sp_manage_articles' => array(false, 'sp', 'sp'),
'sp_manage_pages' => array(false, 'sp', 'sp'),
'sp_manage_shoutbox' => array(false, 'sp', 'sp'),
'sp_add_article' => array(false, 'sp', 'sp'),
'sp_auto_article_approval' => array(false, 'sp', 'sp'),
'sp_remove_article' => array(false, 'sp', 'sp'),
'pm_send' => array(false, 'pm', 'use_pm_system'),
'calendar_view' => array(false, 'calendar', 'view_basic_info'),
'calendar_post' => array(false, 'calendar', 'post_calendar'),
'calendar_edit' => array(true, 'calendar', 'post_calendar', 'moderate_general'),
'admin_forum' => array(false, 'maintenance', 'administrate'),
'manage_boards' => array(false, 'maintenance', 'administrate'),
'manage_attachments' => array(false, 'maintenance', 'administrate'),
'manage_smileys' => array(false, 'maintenance', 'administrate'),
'edit_news' => array(false, 'maintenance', 'administrate'),
'admin_maintmode' => array(false, 'maintenance', 'administrate'),
'access_mod_center' => array(false, 'maintenance', 'moderate_general'),
'moderate_forum' => array(false, 'member_admin', 'moderate_general'),
'manage_membergroups' => array(false, 'member_admin', 'administrate'),
'manage_permissions' => array(false, 'member_admin', 'administrate'),
'manage_bans' => array(false, 'member_admin', 'administrate'),
'send_mail' => array(false, 'member_admin', 'administrate'),
'issue_warning' => array(false, 'member_admin', 'moderate_general'),
'edit_display_name' => array(true, 'profile', 'edit_profile'),
'profile_view' => array(true, 'profile', 'view_basic_info', 'view_basic_info'),
'profile_identity' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_forum' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_password' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_extra' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_signature' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_other' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_title' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_blurb' => array(true, 'profile', 'edit_profile', 'moderate_general'),
'profile_remove' => array(true, 'profile', 'delete_account', 'moderate_general'),
'make_bookmarks' => array(false, 'general', 'view_basic_info'),
'profile_server_avatar' => array(false, 'profile', 'use_avatar'),
'profile_upload_avatar' => array(false, 'profile', 'use_avatar'),
'profile_remote_avatar' => array(false, 'profile', 'use_avatar'),
'hide_online_status' => array(false, 'hide_online_status', 'hide_online_status'),
'profile_ccolor' => array(false, 'profile', 'edit_profile'),
'annoyuser' => array(false, 'member_admin', 'moderate_general'),
)
'board' => array(
'moderate_board' => array(false, 'general_board', 'moderate'),
'approve_posts' => array(false, 'general_board', 'moderate'),
'post_new' => array(false, 'topic', 'make_posts'),
'post_unapproved_topics' => array(false, 'topic', 'make_unapproved_posts'),
'post_unapproved_replies' => array(true, 'topic', 'make_unapproved_posts', 'make_unapproved_posts'),
'post_reply' => array(true, 'topic', 'make_posts', 'make_posts'),
'merge_any' => array(false, 'topic', 'moderate'),
'split_any' => array(false, 'topic', 'moderate'),
'send_topic' => array(false, 'topic', 'moderate'),
'make_sticky' => array(false, 'topic', 'moderate'),
'move' => array(true, 'topic', 'moderate', 'moderate'),
'clone' => array(true, 'topic', 'moderate', 'moderate'),
'lock' => array(true, 'topic', 'moderate', 'moderate'),
'remove' => array(true, 'topic', 'modify', 'moderate'),
'modify_replies' => array(false, 'topic', 'moderate'),//
'change_all_subjects' => array(true, 'topic', 'moderate'),

'delete_replies' => array(false, 'topic', 'moderate'),
'announce_topic' => array(false, 'topic', 'moderate'),
'delete' => array(true, 'post', 'modify', 'moderate'),
'modify' => array(true, 'post', 'modify', 'moderate'),
'report_any' => array(false, 'post', 'participate'),
'poll_view' => array(false, 'poll', 'participate'),
'poll_vote' => array(false, 'poll', 'participate'),
'poll_post' => array(false, 'poll', 'post_polls'),
'poll_add' => array(true, 'poll', 'post_polls', 'moderate'),
'poll_edit' => array(true, 'poll', 'modify', 'moderate'),
'poll_lock' => array(true, 'poll', 'moderate', 'moderate'),
'poll_remove' => array(true, 'poll', 'modify', 'moderate'),
'mark_any_notify' => array(false, 'notification', 'notification'),
'mark_notify' => array(false, 'notification', 'notification'),
'view_attachments' => array(false, 'attachment', 'participate'),
'post_unapproved_attachments' => array(false, 'attachment', 'make_unapproved_posts'),
'post_attachment' => array(false, 'attachment', 'attach'),
            'post_as_alternative_user' => array(false, 'post', 'moderate'),
),
);


It says the problem is in line of 'board' => array(

I don't really get what is the problem, but it says: "unexpected T_CONSTANT_ENCAPSED_STRING". :(

What should I do?

Skhilled

I'm not much of a coder myself but I do see something different. The middle line here:

'view_ic' => array(false, 'icp', 'icp'),
'false', 'icp', 'icp'),
                        'karmalog_view' => array(false, 'general', 'view_basic_info'),


It does not have the same format as the other lines. I'd remove it and see if that works.

EDIT: And what file is that? I assume it is /Sourses/ManagePermissions.php?

The_Asker

Yes, it is.

I removed it, and got still an error:

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING"

In the line of:

) 'board' => array(


Note: I added the left bracket to the code because it says also "expected '(' " in the same line, so after adding it that error was removed and I only have the T_CONSTANT_ENCAPSED_string.

I really do not get it, google translate couldn't even translate "encapsed" to my language...

Skhilled

OK, then try this for that line...change this:


      )
      'board' => array(


To this:


      ),
      'board' => array(

The_Asker

Current lines I have:



'annoyuser' => array(false, 'member_admin', 'moderate_general'),
),
) 'board' => array(
'moderate_board' => array(false, 'general_board', 'moderate'),



Current error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

In line:

) 'board' => array(

Skhilled

You did not do it correctly...get rid of the first ")" right before " 'board' ". What editor are you using? It should not have put that there?

The_Asker

Everything works fine now. :D

Thanks.  ;D

I am not using any PHP editor... I was just editing the file via the file manager that I have with the control panel of the host... I have Microsoft Visual Studio 2010 but it only has C#, F# and visual studio. Anyway, I found today PHP editor in the internet. :P

Skhilled

Depending on the hosting the editor in File Manager may not work correctly. It's always best to use a proper editor like Notepad++ (which I use) or conTEXT...both are free. Or, a good paid one is phpDesigner which does EVERYTHING! It includes FTP, Putty, projects so if you have multiple sites it will keep things separated, a SVN for connecting to github or assembla and a ton of other features.