Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: MU Doesnt work properly as you cant add new pages?  (Read 2259 times)

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
MU Doesnt work properly as you cant add new pages?
« on: August 09, 2010, 09:08:23 PM »

Hi Its been a few years since i last posted on here but i have been running a copy of snews online now for 4 years.  :)

But... now i need to use the MU version for a project. Only problem is the add new page option (Pages: add new)  does not work with the standard installation. No new pages are added. This feature does not work. Everything else does such as adding articles.

Any one have any ideas ?

Thanks

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #1 on: August 09, 2010, 09:16:20 PM »

Hi Alks... and welcome back.  :)

Which version of the MU package are you using - the 1.6.3 version from the Download page or another one?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #2 on: August 09, 2010, 09:47:04 PM »

Hi Keyrocks - that was quick reply!

Yes i am using the 1.6.3 version from the download page. I have a copy of single user 1.6 running on my localhost without any problems (as well as a live verison for my own website). I installed 1.6MU  on my localhost and it works fine except for this create new page issue. Its just says page created successfully! but no page exists - it just says no content? and no page link appears either?

thanks,

Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #3 on: August 09, 2010, 10:24:52 PM »

Ok, i have solved it it seams. I looked back through my snews 1.6 file and noticed a fix on there that i put in 4 years ago.

if ($contents == 'page_new' || $edit_option == 3) {
   echo '<input type="hidden" name="define_category" id="category" value="0" />';
   }

something to do with the version of mysql on my computer. I have now added this to the MU version and it suddenly works. No idea why i didnt spot that when i checked earlier!!

Apologies, i have not done much php recently due to a severe illness (that i just recovered from after 3 years) so i'm having to re-learn lots of stuff inlcuding snews.

Actually you will be glad to hear that the club i am designing a website for using snews have decided that they like snews as it is easier to use than thier current joomla insatllation. I let them log into my own website and they loved the ese of use and simplicity. :)

thanks a lot

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #4 on: August 09, 2010, 10:27:46 PM »

I don't have any more time to look into it today but I've installed a fresh package from the download on my local-machine and gave it a quick test-run.

I created a new page and it does not show in the menus but it is in the articles table (in the database) and it is in the Admin => Pages => VIEW panel. There's a status line beside it that says "needs approval". Looking in the articles table, the "approved" value for that page is "NO".

The "needs approval text is generated from the language variables section with the variable $l['pub_status_3']... which is where the language variable/value strings are for the Approve Content mods. So there must be some little bug in the snewsMU.php file related to that mod. You can find all mod locations in the file by searching for  # Content approval if you'd like to get familiar with it now.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #5 on: August 09, 2010, 10:29:44 PM »

Ok, i have solved it it seams. I looked back through my snews 1.6 file and noticed a fix on there that i put in 4 years ago.

if ($contents == 'page_new' || $edit_option == 3) {
   echo '<input type="hidden" name="define_category" id="category" value="0" />';
   }

something to do with the version of mysql on my computer. I have now added this to the MU version and it suddenly works. No idea why i didnt spot that when i checked earlier!!

Apologies, i have not done much php recently due to a severe illness (that i just recovered from after 3 years) so i'm having to re-learn lots of stuff inlcuding snews.

thanks a lot

alks

No problem.
Just play with it some more to be sure and it it's OK, then disregard my last message.
It's been a while since I worked with that particular package too.  :)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #6 on: August 10, 2010, 01:05:30 AM »

thanks, it seams ok now (so far!)

just a few little questions now ive had chance to play with it.....

1) What is the Site Owner tick box for when you create a new user? what effect does it have?

2) When i create a new Super Editor and select the option "Allow this user access to Files section" how come when i log in as the super editor i cannot view the files section? It seams you can only access the file manager as a admin user.

thanks,

alks
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #7 on: August 10, 2010, 05:10:52 PM »

thanks, it seams ok now (so far!)

1) What is the Site Owner tick box for when you create a new user? what effect does it have?

2) When i create a new Super Editor and select the option "Allow this user access to Files section" how come when i log in as the super editor i cannot view the files section? It seams you can only access the file manager as a admin user.


User Account Permissions:

By default, the sNewsMU 1.6.3 package uses four Admin panels on the the Main Administration Page:
   1. Content Management - links to all (category, article, extra and page) Add/Edit/Delete panels.
   2. Comments Approval - if enabled, lists comments waiting for Admin approval.
   3. Site - site settings panel, Users List (with profile/permissions editing), Add New Users.
   4. File Manager - files, uploading, view and delete files in accessible folders.

By default, the sNewsMU 1.6.3 package has four User account Levels.
The default access permissions for each are as follows:

Admin (level 1) - default site owner, with access to all four admin panels.

Super Editor (level 2) - content Management (panel 1) Only. Can View, Edit or Delete any existing content on the site.

Editor (level 3) - Content Management (panel 1) only. Can only view, Edit or Delete self-authored content. Can content by other authors (editors) if permission is granted by the original author when creating or editing the content.

User (level 4) - no admin access

Additional Access Privileges:

The Admin account is the only one that can access the Site (3) panel to manage site settings, create and and manage user accounts.

The Admin can give the Super Editor and Editor accounts access to the Comments Approval and File Manager (2nd & 4th panels) when creating a new account or editing and existing user's privileges.

The Admin can also assign "Site Owner" status to any other account, which removes the Freeze/Delete links from it in the Users panel. This can be removed by the Admin as well after being applied.

The User account (level 4) is to create accounts that have the privilege of posting comments when Comments posting is restricted only ot registered users.
The Admin's User Privilege settings panel available for Editor accounts is also visible for User accounts so that, if the Admin chooses to upgrade a User account to a higher level (3, 2 or 1), these settings will apply at those levels. If they are checked for a User (level 4) they will not apply until the account is upgraded to a higher level (3, 2 or 1).
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #8 on: August 11, 2010, 10:09:17 AM »

Thanks for your detailed explanation - very useful - especially as i will have to write a basic tutorial for the users of the site when it goes live.

However you say : "The Admin can give the Super Editor and Editor accounts access to the Comments Approval and File Manager (2nd & 4th panels) when creating a new account or editing and existing user's privileges."

It does not seam possible to give Super editor or editor access to the File Manager even if you tick the box option for it. As well as this if you wish to edit the editors existing privileges (after you have created the new user) the options for alllowing access to files and approval is nolonger an option on the edit list. Is this a bug or something i'm missing?

Many thanks,

alks
« Last Edit: August 11, 2010, 11:42:27 AM by alks »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #9 on: August 11, 2010, 03:07:27 PM »

It does not seam possible to give Super editor or editor access to the File Manager even if you tick the box option for it. As well as this if you wish to edit the editors existing privileges (after you have created the new user) the options for alllowing access to files and approval is nolonger an option on the edit list. Is this a bug or something i'm missing?

Many thanks, alks

OK... I've just run through the steps again for Super Editor and Editor accounts on my local-machine install.

Once you are logged in as Admin, click the "Users" link in the SITE panel on the main Admin page.
This takes you to list of existing user accounts.

Click any account's "Profile Link" and, on the Profile page, there should be 3 blocks:
     1. Editing Profile: (user-name) - in full view,
     2. Change Password - in collapsed view,
     3. User Privilege Level - in collapsed view.

Click the "User Privilege Level" text-link (title) in the 3rd block to expand the panel.
In that panel, you should see a drop-down field that shows the account current level (either Super Editor, Editor or User, which you can change) along with the 3 check-boxes that you would have seen when you first created the account. Make changes there and click the SAVE button.

My tests show that they are working fine on my install... which is the same package as the one available from the Download page.
     2. Checkbox - "Allow
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #10 on: August 11, 2010, 03:59:00 PM »

Hi Keyrocks, thankyou for looking into this for me,

you say : Click the "User Privilege Level" text-link (title) in the 3rd block to expand the panel.
In that panel, you should see a drop-down field that shows the account current level (either Super Editor, Editor or User, which you can change) along with the 3 check-boxes that you would have seen when you first created the account.

yes these are there however the 3 check boxes are not visible on my install (only there when i first created the super editor account). I downloaded the correct package from the downloads page and set it up as a standard install. this is very odd? any ideas? Here is a screenshot - logged in as Admin looking at the super editor profile:



thanks,

alks
« Last Edit: August 11, 2010, 04:20:22 PM by alks »
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #11 on: August 11, 2010, 04:44:02 PM »

Hi Keyrocks, thankyou for looking into this for me,

yes these are there however the 3 check boxes are not visible on my install (only there when i first created the super editor account). I downloaded the correct package from the downloads page and set it up as a standard install. this is very odd? any ideas? Here is a screenshot - logged in as Admin looking at the super editor profile:

Hmmm... yes. My apologies. It appears the snewsMU.php file I am working with is not the same as the one you downloaded.
I just downloaded and installed a fresh one and I am now experiencing the same issue.
I'll run a file comparison check and see what I can come up with and will get back to you soon.
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: MU Doesnt work properly as you cant add new pages?
« Reply #12 on: August 11, 2010, 05:16:32 PM »

OK. I see what's happening.
I'll be continuing to add information to this post so refresh this page every few minutes as I go along to see where we're going as we explore this.

If you have your snewsMU.php file open in your code editor...

1. Search the file for echo '<select id="level" name="user_level">';.
    Skip the first occurence and stop at the second occurence, which should be around line 1136.

Below it, you'll notice four strings that look quite the same, the first starts with  echo '<option value="1"'.($level == '1' for level 1 user and the 4th starts with echo '<option value="4"'.($level == '4' for leve 4 user. This is the drop-down.

Below it is a commented section with a FIX: by bakercad... where the active string after the commented section checks to seek if the suers is level 1 (admin) and is the site owner and, if so, the next 2 echo strings generate the 2 check-box strings you're looking for.

Then, under those, Bakercad has another FIXED string which also checks to see if the user is Admin and is the site owner and, if so, should generate the "Site Owner" check-box.

These should be displaying if the person logged in is the Admin AND is the site owner, which is what the Admin is.
But it's not working.
So, I had replaced all of Bakercad's patches with a large patch that lets the admin see all three check-boxes under the dropdown.

Identify this section of code and remove it and put it in a safe file for the time being:
Code: [Select]
<?php

// ----------------------- START OF REMOVED SECTION -------------------------------------------------------

if (get_identity($_SESSION['id'], 'level') == '1') {
echo html_input('fieldset''''''''''''''''''''''''''','<a title="'.l('mu_userlevel').'" onclick="toggle(\'sub2\')" style="cursor: pointer;">'.l('mu_userlevel').'</a>');
echo '<div id="sub2" style="display: none;">';
echo '<select id="level" name="user_level">';
echo '<option value="1"'.($level == '1' ' selected="selected"' '').'>'.l('mu_level_admin').'</option>';
echo '<option value="2"'.($level == '2' ' selected="selected"' '').'>'.l('mu_level_supereditor').'</option>';
echo '<option value="3"'.($level == '3' ' selected="selected"' '').'>'.l('mu_level_editor').'</option>';
echo '<option value="4"'.($level == '4' ' selected="selected"' '').'>'.l('mu_level_user').'</option></select>';
/************************************************************************
2008-1-11
FIX: by bakercad
Problem: Admin wasn't able to set this information, Super Editor and Editor shoudn't have this option. Only Admin with Site Owner privileges should have this acces
Offening code: if ($level == '2' || $level == '3'){
************************************************************************/
if ($level == '1' && get_identity($_SESSION['id'], 'site_owner') == 'YES'){
// END FIX
echo html_input('checkbox''edit_comments''edcom''YES'l('mu_edit_comments'), ''''''''$edit_comments'''''''''''');
echo html_input('checkbox''permit_upload''pfiles''YES'l('mu_permit_upload'), ''''''''$permit_upload'''''''''');
/************************************************************************
2008-1-11
FIX: by bakercad
Problem: $_GET['id'] is incorrect code
Offening code: if (get_identity($_GET['id'], 'site_owner') == 'YES'){
************************************************************************/
if (get_identity($_SESSION['id'], 'site_owner') == 'YES'){
// END FIX
echo html_input('checkbox''site_owner''sowner''YES'l('mu_site_owner'), ''''''''$site_owner'''''''''');
}
/************************************************************************
2008-1-11
FIX: by bakercad
Problem: no code to set in site_owner field in db table
Offening code: N/A
************************************************************************/
else {
echo html_input('hidden''site_owner''siteown''NO''''''''''''''''''''''');
}
// END FIX
}
echo '</div></fieldset>';
}

// ----------------------- END OF REMOVED SECTION -------------------------------------------------------

?>


and, above (or below) it, paste in this revised section:
Code: [Select]
<?php

// START: User Privilege Level Panel
/************************************************************************
FIX: (keyrocks, Nov.04.09)
Problem: Admin wasn't able to see 3 check-box options.
Super Editor and Editor shoudn't have this option but Admin should.
This fix shows the full User Privilege Panel only to the Admin(1)
************************************************************************/
# If logged-in user is Admin (level 1)
if (get_identity($_SESSION['id'], 'level') == '1') {
    # Show User Privilege Level Panel -------------------
    echo html_input('fieldset''''''''''''''''''''''''''','<a title="'.l('mu_userlevel').'" onclick="toggle(\'sub2\')" style="cursor: pointer;">'.l('mu_userlevel').'</a>');
    echo '<div id="sub2" style="display: none;">';
    # User level drop-down, 5 strings
    echo '<select id="level" name="user_level">';
    echo '<option value="1"'.($level == '1' ' selected="selected"' '').'>'.l('mu_level_admin').'</option>';
    echo '<option value="2"'.($level == '2' ' selected="selected"' '').'>'.l('mu_level_supereditor').'</option>';
    echo '<option value="3"'.($level == '3' ' selected="selected"' '').'>'.l('mu_level_editor').'</option>';
    echo '<option value="4"'.($level == '4' ' selected="selected"' '').'>'.l('mu_level_user').'</option></select>';
    # check-box: edit comments option
    echo html_input('checkbox''edit_comments''edcom''YES'l('mu_edit_comments'), ''''''''$edit_comments'''''''''''');
    # check-box: files manager access option
    echo html_input('checkbox''permit_upload''pfiles''YES'l('mu_permit_upload'), ''''''''$permit_upload'''''''''');
    # If logged-in user's site owner status is YES
    if (get_identity($_SESSION['id'], 'site_owner') == 'YES'){
# show site owner status as checked
echo html_input('checkbox''site_owner''sowner''YES'l('mu_site_owner'), ''''''''$site_owner'''''''''');
    } else { # show site owner status as un-checked
echo html_input('hidden''site_owner''siteown''NO''''''''''''''''''''''');
    }
    echo '</div></fieldset>';
}
# END: User Privilege Level Panel ----------

?>

« Last Edit: August 11, 2010, 06:05:27 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #13 on: August 11, 2010, 05:28:15 PM »

thanks for looking into this, i am looking at the code now. It must be the fix that has caused it to act differntly than the copy you have? I am looking at it but i dont see why its not displaying....

« Last Edit: August 11, 2010, 05:41:28 PM by alks »
Logged

alks

  • Jr. Member
  • **
  • Karma: 0
  • Posts: 53
Re: MU Doesnt work properly as you cant add new pages?
« Reply #14 on: August 11, 2010, 06:03:32 PM »


i tried this at about line 1147, under the drop down menu where the first fix is. I changed the code to this:

if ($level == '1' || $level =='2' && get_identity($_SESSION['id'], 'site_owner') == 'YES') {

i just added an extra OR in there, and it appears to have worked. But i'm not sure this is the correct way to do this as it appears that the original OR was taken out for the fix in the first place.?
Logged
Pages: [1] 2