0 users online. Create an account or sign in to join them.Users

Search

try form-controls by nick dunn http://github.com/nickdunn/form-controls look into this <xsl:call-template name="form:validation-summary"/>

Im not sure if that will return what your looking for but its where i would start.

ps. that reminds me i need to add that to my login :)

Hm, if I want to use the form-controls what would be the event to put into ### then?

<xsl:variable name="form:event" select="###"/>

whatever your login event is called /data/events/eventname

dont forget to put this stuff in your template header or it wont work.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
xmlns:form="http://nick-dunn.co.uk/xslt/form-controls"
extension-element-prefixes="exsl form">

whatever your login event is called /data/events/eventname

I don’t know the event of the frontend membership extension. Do I need to create an extra event? Login/out currently works without. my debug:

<data>
    <events>
        <member-login-info logged-in="false" />
        <login-info logged-in="true" id="1" user-type="developer" primary-account="yes">
            <name>John Doe</name>
            <username>jd</username>
            <email>info@mydomain.de</email>
        </login-info>
    </events>

Login/out currently works without.

Frontend Membership login/out is implemented in <member-login-info logged-in="false" />. Backend login/out is implemented in <login-info />.

So yes, the event is there. :-)

So yes, the event is there. :-)

Sorry for all these stupid questions and thanks for the hint. Will do a little more testing…

Hi!

I wanted to do something like this:

<xsl:when test="/data/events/member-login-info/@failed-login-attempt = 'true'">

(like in the forum ensemble [207 branch]) BUT it didn’t work. So I compared the extension.driver.php of the two (different) member extensions. If I replace the “Cookies only show up at page refresh” code of the official frontend member extension with the code below (forum ensemble)

## Cookies only show up on page refresh. This flag helps in making sure the correct XML is being set
            $loggedin = false;

            $action = $_REQUEST['member-action'];
            if (is_string($action)) $action = array($action => true);

            if(isset($action['logout'])){
                $this->logout();
                redirect(URL);
            }

            elseif(isset($action['login'])){

                $username = Symphony::Database()->cleanValue($_REQUEST['username']);
                $password = Symphony::Database()->cleanValue($_REQUEST['password']);

                if($this->login($username, $password)){

                    if(isset($_REQUEST['redirect'])) redirect($_REQUEST['redirect']);

                    redirect(URL . $_SERVER['REQUEST_URI']);
                }

                self::$_failed_login_attempt = true;

            }

and replace my login call

<input name="redirect" type="hidden" value="{$root}/"/><input id="submit" type="submit" name="member-action" value="Log In" class="button"/>

with

<input name="redirect" type="hidden" value="{$root}/"/><input id="submit" type="submit" name="member-action[login]" value="Log In" class="button"/>

it works. Don’t know if this is a bug or if I just did something stupid. Can somebody please have a look at it. Thanks

looks like it has something to do with replacing trim with isset. But I am no expert…

Don’t know if this is a bug or if I just did something stupid.

The only purpose of the modification you find in the ensemble is to make the extension compatible with php 5.3. I believe that what you came up with your xslt code is enough to get things run correctly.

You are right… don’t know why it didn’t work in the first place. Thanks!

Hi,

I have a custom event using eventex but it fails because the event does not have a user permissions setting.

What would are the requirements from an event to pass the permissions check?

@jeffleeder If I understand your question correctly, I believe you need to set the Event Level permissions in the /symphony/extension/members/roles/ section. When you select on the role in question you should see something like the attached image. Setting permissions by event by role should clear things up for you. alt text

Attachments:
permissions-symphony-members.png

Its more complex then that see here.

eventex thread

I have a problem with the update of a single item in the front end too, isn’t a problem of permissions. During the creation of a new item in the front-end all it’s ok, but during the update I receive a:

Symphony Fatal Database Error - Table ‘test.symentriesdata_0’ doesn’t exist An error occurred while attempting to execute the following query * SELECT * FROM sym_entries_data_0 WHERE entry_id = 42 LIMIT 1

First I was unable to use the file field: I’ve changed the line 590 of class.general.php in “if (empty($value)) continue;” and it worked but, the updating fails.

This is the form: <form method="post" action="" enctype="multipart/form-data"> <input name="MAX_FILE_SIZE" type="hidden" value="5242880" /> <input name="fields[pubblicato]" type="hidden" value="No" /> <input name="id" type="hidden" value="{@id}" /> <input name="action[allega]" type="submit" value="Submit" /> </form>

suggests?

Try Adding a Member link field to the section and when the entry is created add the members ID to it. Then try editing.

The member link gives the membership extension a way to check that you have permission to edit because the edit has edit own or edit all. If it doesnt have a member link then it cant check to see if you have permission.

Jeff that was THE ANSWER! Thanks for your help!!!

Is there a way to remove the need for both Username and Email Address? The majority of members areas I create I do-away with a Username in favour of using the Email Address.

Perhaps the Username/Password field could support a Validation Rule (regex) for both Username and Password (so that I could enforce an email address as a username and enforce minimum length for passwords) and if I set the “Email Address Field” in Members > Setup to point to the Username/Password field, for it to recognise this and treat the Username as an email address?

I think I have solved this. This change should allow the Members setup to point the “Email” field to your Member (username/password) field, negating the need for a separate Email address.

I haven’t sent a pull request because I’m still testing, but thought I’d mention it in case anyone needs it pronto.

The solution provided by Jeff was correct but… If I want add an item from the front end?

Then I’ve replaced the two functions:

        public function fetchMemberFromID($member_id){
        $driver = Administration::instance()->ExtensionManager->create('members');
        return $driver->initialiseMemberObject($member_id);                 
    }

    public function fetchMemberFromUsername($username){
        $driver = Administration::instance()->ExtensionManager->create('members');
        $member_id = $this->Database->fetchVar('entry_id', 0, "SELECT `entry_id` FROM `sym_entries_data_".$driver->usernameAndPasswordField()."` WHERE `username` = '".$username."' LIMIT 1");

        return ($member_id ? $this->fetchMemberFromID($member_id) : NULL);
    }   

With:

        public function fetchMemberFromID($member_id){
        if(class_exists('Frontend')){
            $driver = Frontend::instance()->ExtensionManager->create('members');
        }
        else{
            $driver = Administration::instance()->ExtensionManager->create('members');
        }
        return $driver->initialiseMemberObject($member_id);                 
    }

    public function fetchMemberFromUsername($username){
        if(class_exists('Frontend')){
            $driver = Frontend::instance()->ExtensionManager->create('members');
        }
        else{
            $driver = Administration::instance()->ExtensionManager->create('members');
        }
        $member_id = $this->Database->fetchVar('entry_id', 0, "SELECT `entry_id` FROM `sym_entries_data_".$driver->usernameAndPasswordField()."` WHERE `username` = '".$username."' LIMIT 1");

        return ($member_id ? $this->fetchMemberFromID($member_id) : NULL);
    }   

And now works!

Hey everyone, what version of 2.0.7 or 2.0.8 RC1 have y’all found to be most stable to work with this extension?

Thanks for your help!

I am afraid I can’t really help here…

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.1
  • 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