Search

One idea would be to create a front end form that controls access to each of these entries. You can use Form Controls and Section Schemas to rebuild the Symphony admin interface, or create a custom interface, then use the Frontend Membership extension to control user access.

You could also use the Single Entry extension to let them edit one section each and have it only show one entry.

In 2.0.8 when this extension is enabled it removes all the navigation groups for the publish sections from the nav bar so only BLUEPRINTS and SYSTEM are shown.

The extension functionality appears to be working perfectly and I can still access the publish areas through the address bar the links are just removed from the nav bar.

Anyone have any ideas why this might be?

Yeah, when you install it, you will have to go straight to the author preferences and set your author section.

I do think it will need updating to set all sections for developers though…

I do think it will need updating to set all sections for developers though…

Nice idea. But in this case you might forget to set the sections for authors! :-)

Ahh, I see. I probably should have worked that out.

So this extension only removes disallowed sections from the navigation and doesn’t actually block authors from viewing disallowed content if they navigate straight to the page via the address bar.

Actually blocking the disallowed pages would be a nice feature to add

I agree yeah, but I think that would be difficult. I think the point is that if it is all set up correctly before an author got to see it, then they wouldn’t even know what the URLs would be, and wouldn’t find it too easy to guess what they are.

Author Section updated to version 0.5 on 19th of August 2010

Bugfix: an Author was still allowed to set it’s ‘default section’ to an unauthorized section. This is fixed now, so that the Author can only choose one of it’s allowed sections as default section

@kanduvisla What changes have you implemented?

None, it’s a bugfix.

Cool, thanks…

This functionality is not yet supported in this extension. I was thinking however to extend it with functionality with which you can manage the ability to add new, delete or edit.

However, I first must have a client who requires something like this, otherwise I can’t spend the time on it ;-)

edit: oops, this was a reply on http://getsymphony.com/discuss/thread/39595/#position-20

I’m not sure what happened but suddenly I started to get this error after having the plugin working for a while. I have it working in other symphony installations so I know it’s not just the plugin and must have something to do with my installation.

It seems to me that $doc->loadHTML($context[‘output’]); is either context[‘output’] contains malformed html or that it doesn’t exist. I don’t really understand Symphony extensions so I can’t work out where $context[‘output’] is set to debug it.

I’ve attached a screenshot of the error page.

Here’s the html of the function being effected:

public function __appendAssets($context) {
            $callback = Administration::instance()->getPageCallback();
            // Check if the current logged in user is an developer:
            if(!empty(Administration::instance()->Author)) {
                if(Administration::instance()->Author->isDeveloper()) {
                    if($callback['driver']=='systemauthors') {
                        if(is_array($callback['context'])) {
                            if($callback['context'][0] == 'new') {
                                $authorID = 0;
                            } else {
                                $authorID = $callback['context'][1];
                            }

                            // Add items to this page:
                            $group = new XMLElement('fieldset');
                            $group->setAttribute('class', 'settings');
                            $group->appendChild(new XMLElement('legend', 'Allowed sections'));          

                            $prefix = 'sym_';

                            // Show the sections:
                            $sql      = 'SELECT * FROM `'.$prefix.'sections`';
                            $sections = Administration::instance()->Database->fetch($sql);                  

                            // Get the allowed stuff:
                            $sql     = 'SELECT * FROM `'.$prefix.'author_sections`';
                            $sql    .= $authorID != 0 ? ' WHERE `id_author` = '.$authorID.';' : ';';                    
                            $allowed = Administration::instance()->Database->fetch($sql);
                            $ids     = array();
                            foreach($allowed as $a) {
                                array_push($ids, $a['id_section']);
                            }

                            $content = '<fieldset class="settings"><legend>Allowed sections</legend>';
                            foreach($sections as $section) {
                                $selected = in_array($section['id'], $ids) ? ' checked="checked"' : '';
                                $content .= '<label><input type="checkbox" name="fields[author_section][section_'.$section['id'].']" '.$selected. ' />'.$section['name'].'</label>';
                            }                   
                            $content .= '<input type="hidden" name="fields[author_id]" value="'.$authorID.'" />';
                            $content .= '</fieldset>';

                            // Load current document
                            $doc = new DOMDocument();
                            $doc->loadHTML($context['output']);

                            $fieldset = $doc->createDocumentFragment();
                            $fieldset->appendXML($content);

                            $xpath = new DOMXPath($doc);                    

                            $settings = $xpath->query("//fieldset[@class='settings']");
                            $actions = $xpath->query("//div[@class='actions']")->item(0);                   

                            if($settings->length > 0) {
                                $actions->parentNode->insertBefore($fieldset, $actions);
                            }

                            $context['output'] = $doc->saveHTML();
                        }               
                    }
                }
            }
        }
Attachments:
Screen shot 2010-09-17 at 11.21.17.png

Hmm it looks like this extension uses a rather nefarious method of appending items to the System Preferences page! It waits for the page HTML to be generated, then parses it as XML (prone to error) and injects the form elements into the HTML.

This should certainly be rewritten to use the Preferences Delegates instead which are far more robust and designed for this purpose.

is there a trick to getting this to work with nick’s dashboard?

What are you trying to achieve? They aren’t integrated so it probably won’t work straight away, but there’s potential for making them work together.

with author section enabled, you can’t view the dashboard anymore, nor can you make the dashboard the default section for any authors even after author section disabled or uninstalled.

@nickdunn: this was my first extension so I wasn’t so aware of the way things flow in Symphony. I’ll look into this. But I want to append content to the author-page, not to the preferences page, so this wil not be in system/preferences, but in system/authors/edit or /add/. What should be the best way to achieve this?

@fawx: I’ll look into this. The issue is probably because ‘dashboard’ is not so much of a specific section, but more something specific supplied by another extension.

@odogg (Myself) - Worked out that an ampersand in a section name was causing the malformed XML which caused the error. Escaping reserved xml characters might be a good idea in future updates to the plugin

Author Section updated to version 0.6 on 20th of September 2010

  • Added functionality so there would be no conflict with the ‘Dashboard’-extension
  • Rewritten code to build the author-screen because it was causing conflicts in certain situations. (and it was really crappy coding)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details