WebSite X5Help Center

 
Sascha J.
Sascha J.
User

Is it possible to create more automatic registration Textboxes?  en

Auteur : Sascha J.
Visité 2436, Followers 1, Partagé 0  

Like, I mean, there's just, Username, Password, Name and E-Mail. I'm using Automatic Registration, because I don't have no time to add every single User by hand.

  • Is there a way to create more options like adress and such?

Because I'm creating a Webstore and I need the adresses of the customers.

First I wanted to use the E-Mail Form, (on a Private User Aeria(Locked Page), which will sent the information to my database) but then I realized that once they sent out the information, the E-Mail form is still present. I mean, if someone is forgetable and won't recognize if he entered his information, he will do it again.

  • Is there a way to hide the E-Mail Form after they entered their information and it's sent to my database?

Thanks.

Posté le
4 RéPONSES - 2 UTILE - 1 CORRECT
Paul M.
Paul M.
Moderator

Hello Sascha,

The only way to add extra fields to the automatic registration is by editing certain files (mainly 'x5engine.php' in the 'res' folder) on the server.  Understandably, Incomedia don't offer support for such customisations, as if not done correctly then it will break other features in the software.  You could open an Idea post to request that this be added as a possibility in future updates.

Likewise, you cannot hide an Email Form Object by default using WebSite X5's native features.  You could use custom code (PHP/MySQL) to test for submitted data from an existing user in the database, then redirect them away from the page containing the Email Form if the data was found to be present.  This could be done virtually instantaneously using code before the head section.

Kind regards,

Paul

Lire plus
Posté le de Paul M.
Sascha J.
Sascha J.
User
Auteur

Hello Paul,

I understand.

So do I have to change it somewhere here in the code?

     */
    function getUserByUsername($username)
    {
        global $imSettings;
        
        // Search in the file
        if (isset($imSettings['access']['users'][$username])) {
            $user = $imSettings['access']['users'][$username];
            return array(
                "id"        => $user['id'],
                "ts"        => "",
                "ip"        => "",
                "username"  => $username,
                "password"  => $user['password'],
                "realname"  => $user['name'],
                "email"     => $user['email'],
                "key"       => "",
                "validated" => true,
                "groups"    => $user['groups']
            );
        }
        // Search in the DB
        $res = $this->db->query("SELECT * FROM `" . $this->db_table . "` WHERE `username`='" . $this->db->escapeString($username) . "'");
        if (is_array($res) && count($res) > 0) {
            $user = $res[0];
            return array(
                "id"        => $user['id'],
                "ts"        => $user['ts'],
                "ip"        => $user['ip'],
                "username"  => $user['username'],
                "password"  => $user['password'],
                "realname"  => $user['realname'],
                "email"     => $user['email'],
                "key"       => $user['key'],
                "validated" => $user['validated'],
                "groups"    => array($imSettings['access']['webregistrations_gid'])
            );
        }
        return null;
    }

Do I just have to add things like Address, Phonenumber, etc. here?

Lire plus
Posté le de Sascha J.
Paul M.
Paul M.
Moderator

You would need to edit that section of code, for sure, but unfortunately there is a lot more to it than that...  there are other files which are affected too, for example, the actual forms themselves: x5engine.php is just part of the back end.

It has been a while since I looked closely at this, but if you trace through the code carefully and methodically then you should be able to work it out.  It is time consuming, Sascha...  you might be better off using a third party plugin if you require greater control over the registration process.

For example:

https://www.phpjabbers.com/member-login-script/

Bear in mind that if you edit any of WebSite X5's native files then you will have to reupload the edited versions to the server after every project alteration which affects any of those files.  You would also need to maintain the modified files, which could change after every update Incomedia release to WebSite X5.  And once again I can't stress enough that Incomedia won't offer support for modified files.

Good luck!

Lire plus
Posté le de Paul M.
Sascha J.
Sascha J.
User
Auteur

Alright Paul, thanks!

I might buy the member login script.

I guess, it doesn't make sense to modify the files, if I have to re-modify them after every update/project alteration.

Thanks once again!

Lire plus
Posté le de Sascha J.