1

Topic: Plugin: pawUsers

Hello,

my first plugin is ready! :D

pawUsers

An extended User Environment for the Wolf CMS.

Wolf CMS Plugin Repository | Download on GitHub

Attention

This is the first alpha version and therefore it is more important, that you report each bug and request each feature (that you want to see in this plugin) to the GitHub Issue Page or here in the forum! Thank You!

Please do not use this plugin on productive websites/systems. You have been warned!

Requirements

  • PHP 5.3.0 (or better)

  • PHP mail() ability

  • Wolf CMS 0.8.3(.1)

  • MySQL Database (Untested with PostgreSQL and SQLite)

Features

  • An extended User Administration...

  • ... which is designed for the Wolf-own and my WordPress AdminTheme

  • Store and Manage more, costum User Informations

  • Create and Manage more, costum Roles and Permissions

  • Built your own Front-End Account and Profile Pages

  • Offer more Security and use the Blacklist System

Read all Features here

Installation

  1. Download and Unpack the repository.

  2. Upload the paw_users folder to your wolf/plugins/ directory.

  3. Enable the pawUsers plugin!

Sincerely yours,
Sam.

Last edited by SamBrishes (2015-10-27 09:35)

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up +1

2

Re: Plugin: pawUsers

Like your plugin Sam, keep up the good work and keep them coming big_smile

3

Re: Plugin: pawUsers

Thanks, i will give my best. ^^

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

4

Re: Plugin: pawUsers

Hello,
I am already using WolfCMS 7.5 with adv_user and wants to upgrade to 8.3.1 with pawuser.
I have installed a fresh homage and have installed/activated pawuser.

Have created 2 test page with a sidebar:
<?php $this->includeSnippet('pawuser_profile'); ?>
and
<?php $this->includeSnippet('pawuser_account'); ?>

Unfortunaltely I do not see an register, delete or other content.
I have the login for and als the form with all information of the user.

Any help is appreciated.

Thumbs up

5

Re: Plugin: pawUsers

@bongo - it's hard to know what the problem might be if you don't show us your code!

I just installed this on a fresh test site: impressive plugin! smile But I am not sure how to construct user profile pages, etc. hmm Some example code would help - but the documentation looks very promising already.

Btw - @Sam - what happens if I try to delete the only user? Will the plugin do it? The default "user" page won't let you, but the option is there in the plugin page....

Using Wolf CMS professionally and for profit? Please consider supporting Wolf financially. Thanks!

6

Re: Plugin: pawUsers

Hello David,
as I said before I have only created an new page with the 2 different snippets.
I do see the login screen or the userinfo screen.

I have no clue how I can can see i.e. the register screen.

A demo site with admin access would help.

Regards
bongo

I have created a new snippet pawuser_register (copy of pawuser_account) and have changed only $action = "login"; to $action = "register";.
When calling <?php $this->includeSnippet('pawuser_register'); ?> I do see the register form, but I do not think that this is the correct way.

I think it sholud be possible to call <?php $this->includeSnippet('pawuser_account'); ?> with the option "register".

Last edited by bongo (2015-10-24 17:37)

Thumbs up

7

Re: Plugin: pawUsers

Hello,

my RSS Feed Reader doesn't seems to work, i didn't get any notification about a new post. Sorry ^^.

bongo wrote:

Unfortunaltely I do not see an register, delete or other content.
I have the login for and als the form with all information of the user.

Any help is appreciated.

Yes, i missed to add the Footer links on each account form, sorry. You can call each account page as follow
Demonstration

Login / Logout Page = website.com/page_slug
Registration Page = website.com/page_slug?action=register
Activation Page = website.com/page_slug?action=activate
Forgot-Account Page = website.com/page_slug?action=forgot
Remember Account Page = website.com/page_slug?action=remember
Delete Account Page = website.com/page_slug?action=delete

Remember that each page, except logout and delete, can only be viewed if the current user isn't logged in.

David wrote:

I just installed this on a fresh test site: impressive plugin! But I am not sure how to construct user profile pages, etc. hmm Some example code would help - but the documentation looks very promising already.

Thanks ^^. The documentation is unfortunately still incomplete, i work on a "full version". I added a "Profile Snippet", which shows a small example to create own profile pages, but this will be removed in the next version. I try to create a "Profile Page" builder, so that such pages can be created easier (+ a better documentation to create a profile page manually).

David wrote:

Btw - @Sam - what happens if I try to delete the only user? Will the plugin do it? The default "user" page won't let you, but the option is there in the plugin page....

Yes, the plugin should do it, esxcept the user is an administrator. Thanks for that, I will add such a query

bongo wrote:

I think it sholud be possible to call <?php $this->includeSnippet('pawuser_account'); ?> with the option "register".

That's a great idea! I will implement an alternative system, next to the "Profile Page / Account Form" Builder, whichs allow to implement only a single account page.

Sincerely,
Sam.

Last edited by SamBrishes (2015-10-26 23:57)

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up +1

8

Re: Plugin: pawUsers

Hello,

I didn't mentioned on the first post, that the current Version (0.1.0 Alpha) of the paw Users plugin should not be used on productive websites yet. In theory, it should work fine though but how also Windows shows: The theory is often contradicted by the practice.

This version is primarily for testing purposes, to check how the single features works and to check which features are missing. And yes I know, the plugin requires still a lot of work and needs still be greatly improved on many places. I'm working as fast as I can ^^, next to many other plugins and my own Website, which is also powered by the Wolf.

I will do my best. So stay tuned. big_smile

Sincerely,
Sam.

PS.: A current project status (0.2.0 - Alpha) can be found on GitHub.

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

9

Re: Plugin: pawUsers

Hello,
I am struggling a little bit in creating a short report with fields from the tables user and user_meta.

<?php
if(!defined("IN_CMS")){ die(); }
$users = User::findALL(array('order' => 'name ASC'));

print "<table border= 1>";
print "<tr><td>Nr.</td><td>Name</td><td>Vorname</td><td>Nachname</td></tr>";

foreach($users as $user) {

 $meta = pawu_get_user_fields($user->id);        // META USER INFO
 $fields = pawu_get_fields();                // META FIELDS

 print "<tr><td>$user->id</td><td>$user->username</td><td>echo $fields["firstname"]</td><td>xyz</td></tr>";

}

print "</table>";
?>

With $users = User::findALL(array('order' => 'name ASC')); i do get all users from table user.

With

$meta = pawu_get_user_fields($user->id);        // META USER INFO
$fields = pawu_get_fields();                // META FIELDS

I do get all meta-data for the user_id, but how can I get a specific field from user_meta ?

echo $fields["firstname"]
or
echo $meta[$fields["firstname"]]

does not work.

BTW: When downloading the plugin on github I do get still version 0.1.

Last edited by bongo (2015-10-30 10:14)

Thumbs up

10

Re: Plugin: pawUsers

Hello,

bongo wrote:

BTW: When downloading the plugin on github I do get still version 0.1.

Version 0.2.0 is still under development, the link above redirects you only to a Status post, where i publish and update a checklist with all new Stuff, Improvements and fixes for the new version.

bongo wrote:

Hello,
I do get all meta-data for the user_id, but how can I get a specific field from user_meta ?

echo $fields["firstname"]
or
echo $meta[$fields["firstname"]]

Try this:

echo $meta["firstname"];

The pawu_get_fields(); function returns all available fields with the respective field-configuration, but without any user informations (So a Multi-Level array should return).
The pawu_get_user_fields(); function returns all user fields with the stored value or an empty value, if the user doesn't set any stuff (So a Single-Level array shoudl return).

Both arrays are structured like this

array(["field_id1"] => *data*, ["field_id2"] => *data*);

Sincerely,
Sam.

BTW.: Oh, you speak German?

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up +1

11

Re: Plugin: pawUsers

Hello,
I would like to do a request:
- add a new field in user_meta called sort_id

Reason:
I have added several fields i.e. firstname, lastname, birthname, etc to this table. In summary more than 25 fields.
When accessing the edit-mode with .../profile?edit=true all new fields are visible in a ASC name order.

            <?php foreach($fields AS $field){ ?>
                <tr>
                    <td class="label"><label for="user-meta-<?php echo $field["name"]; ?>"><?php echo $field["label"]; ?></label></td>
                    <td><?php echo pawu_print_field($field, $meta[$field["name"]]); ?></td>
                </tr>
            <?php } ?>

I would like to have an option to sort with sort_id.

Means i.e. firstname has sort_id 1, birthname has sort_id 2, etc.

Regards
rs

BTW: How can I add in this case the sort_id as an order option to

<?php foreach($fields AS $field){ ?>

And yes I am german.

Last edited by bongo (2015-10-30 11:33)

Thumbs up +1

12

Re: Plugin: pawUsers

Hello,

bongo wrote:

Hello,
I would like to do a request:
- add a new field in user_meta called sort_id

Reason:
I have added several fields i.e. firstname, lastname, birthname, etc to this table. In summary more than 25 fields.
When accessing the edit-mode with .../profile?edit=true all new fields are visible in a ASC name order.

Yay good idea, thanks! I will add a such a table row / function.

bongo wrote:

BTW: How can I add in this case the sort_id as an order option to

<?php foreach($fields AS $field){ ?>

A way to sort the fields is to define an order array and merge it with the fields array.
Example:

// Add your field ids, in the order you need
$sort = array(
    "birthdate", "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){
    
}

Sincerely,
Sam.

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up +1

13

Re: Plugin: pawUsers

SamBrishes wrote:

A way to sort the fields is to define an order array and merge it with the fields array.
Example:

// Add your field ids, in the order you need
$sort = array(
    "birthdate", "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){
    
}

Sincerely,
Sam.

Cool. Sound easy :-) - I think in this case a new filed sort_id is no longer necessary.

Regards
rs

Thumbs up

14

Re: Plugin: pawUsers

Hello,
I have migrated my fresh local installation (MAMP on MAC) to my website (hosted by STRATO) into a sub-directory. So far so good.
Everything looks good, unfortunaltely I do not get an any email from pawuser:
- have tested "register" and got the message "Du wurdest erfolgreich registriert.
Nun musst du warten, bis ein Admin deinen Account aktiviert." - unfortunately no email was sent to user or admin
- "forgot password" - mail exists, but I got the message "Die Passwort-Vergessen eMail konnte nicht verschickt werden!"

I am also using the plugin fm_contact and here I do get the email - so the server is able to send.
fm_contact is just using "mail($email_to, $email_subject, $nachricht, $headers); "

Any hint where I can add a debug or something ?

UPDATE: Have also tried the issue https://github.com/wolfcms/wolfcms/issues/638, but this does not solve the issue.

Last edited by bongo (2015-11-03 16:38)

Thumbs up

15

Re: Plugin: pawUsers

Hello,

bongo wrote:

- have tested "register" and got the message "Du wurdest erfolgreich registriert.
Nun musst du warten, bis ein Admin deinen Account aktiviert." - unfortunately no email was sent to user or admin

The "Activation Process" is set to "Admin", according to the Success-Message, right?

If yes, then will the user only receive an email after an administrator (or another role with the respective permission) completes the activation through the user menu. (There should be an "Activate" Link on the new user.) Has the user received an email after the activation?

The current version of my plugin doesn't send any eMails to an administrator. I will add a such a function into the next version (So that a defined Admin will be informed about new registrations.). I will also add a respective "Message" directly to the backend, which informs each admin also about new user registrations.

bongo wrote:

- "forgot password" - mail exists, but I got the message "Die Passwort-Vergessen eMail konnte nicht verschickt werden!"

So the eMail was successfully sent, but the plugin gives you an error message?

That's odd, I'll check that.

Sincerely,
Sam.

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

16

Re: Plugin: pawUsers

Hello,
To be clear. I did not get any Email.
Not as a user after a registration and also not after "forgot password" with an already excisting User account.

Is there any log i can activate with pawuser ?

regards
rs

Btw: the requirement for this plugin mentioned that PHP 5.3 will work. Have tried this with 5.3.29 and after activating this plugin I do only see a white page.

Last edited by bongo (2015-11-03 20:17)

Thumbs up

17

Re: Plugin: pawUsers

Hello,

bongo wrote:

Hello,
To be clear. I did not get any Email.
Not as a user after a registration and also not after "forgot password" with an already excisting User account.

Oh sorry, then I misunderstood you. I will check that immediately.

bongo wrote:

Is there any log i can activate with pawuser ?

Nope, is scheduled for version 0.2.0.

bongo wrote:

Btw: the requirement for this plugin mentioned that PHP 5.3 will work. Have tried this with 5.3.29 and after activating this plugin I do only see a white page.

Good to know, Thanks. I will check/fix it.

Sincerely,
Sam.

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

18

Re: Plugin: pawUsers

bongo wrote:
SamBrishes wrote:

A way to sort the fields is to define an order array and merge it with the fields array.
Example:

// Add your field ids, in the order you need
$sort = array(
    "birthdate", "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){
    
}

Sincerely,
Sam.


Cool. Sound easy :-) - I think in this case a new filed sort_id is no longer necessary.

Regards
rs

Hello, it is me again. Have tried the above code, means I have replaced

foreach($fields AS $field){ 

with

$sort = array(
     "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){

Unfortunately it does not work.
Have also tried several "variations" of "foreach(array_merge(array_flip($sort), $fields) AS $field){" without any success.

Any hint is welcome.

Regards
rs

Thumbs up

19

Re: Plugin: pawUsers

Hello,

$sort = array(
     "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){

You replaced the values of the $sort array with your field ids, or rather you added your field ids too, right?

If yes, can you please post a screenshot of your user fields (So the administration table)?

I tried my code again, and it works: Screenshot!

Sincerely,
Sam.

Last edited by SamBrishes (2015-11-04 07:26)

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

20

Re: Plugin: pawUsers

SamBrishes wrote:

Hello,

$sort = array(
     "website", "twitter", "facebook", "google_plus", "about_me"
);
foreach(array_merge(array_flip($sort), $fields) AS $field){

You replaced the values of the $sort array with your field ids, or rather you added your field ids too, right?

If yes, can you please post a screenshot of your user fields (So the administration table)?

I tried my code again, and it works: Screenshot!

Sincerely,
Sam.

Hello,
thanks for your quick answer.
Have tried this again and now it is working - sorry about that, I do not know what went wrong last time. I have not deleted the original field like twitter, facebook, aso.

But, I have also some "radio fileds" included and in this case all possible values are visible (one value per row), but the dedicated value for the user is not highlighted. Additionally the value can not be changed.

Radio fileds:
http://www.directupload.net/file/d/4161 … t5_png.htm

Ouput:
http://www.directupload.net/file/d/4161 … yw_png.htm

Same issue with "checkbox fields". "number fields" and "selectbox fields" are working.

Regards


However, I still impressed about this great plugin.

Last edited by bongo (2015-11-04 08:58)

Thumbs up

21

Re: Plugin: pawUsers

Hello,

bongo wrote:

However, I still impressed about this great plugin.

Thank you! ^^

bongo wrote:

But, I have also some "radio fileds" included and in this case all possible values are visible (one value per row), but the dedicated value for the user is not highlighted. Additionally the value can not be changed.

Same issue with "checkbox fields". "number fields" and "selectbox fields" are working.

Regards

That's strange, i can't reproduce this error. Screenshot

Try this:

  1. Please change the Administration Theme to "Black and White" or "Brown and xxx" and check if it works now.

  2. Please change the "paw_users/system/fields/checkbox.php" as well as the "paw_users/system/fields/radio.php" files with this ones (Click on "Download ZIP").

Still not working?
Which browser do you use?
Which PHP version do you use?

Sincerely,
Sam.

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

22

Re: Plugin: pawUsers

Hello,
the wrong view was in the frontend, not in the backend -sorry for confusion.

But to clarify, at the moment I am using the baseline theme (frontend), with the theme Wolf everything works fine. So, the error is based on the theme.

Next time I will test better.

Regards

Thumbs up

23

Re: Plugin: pawUsers

Hello,
I have still the problem, that no email will be send for i.e. "lost password". I do only get an error message that the email could not be send.

I have seen that in class.users.php all checks (valid name, valid email, etc.) are done, but can you please tell me where the mail-send-process is started. Will try to find out why this happens.

Regards

Last edited by bongo (2015-11-06 07:58)

Thumbs up

24

Re: Plugin: pawUsers

bongo wrote:

Hello,
I have still the problem, that no email will be send for i.e. "lost password". I do only get an error message that the email could not be send.

I have seen that in class.users.php all checks (valid name, valid email, etc.) are done, but can you please tell me where the mail-send-process is started. Will try to find out why this happens.

Regards

Hello,

I'm still searching for a solution or better i currently try to reproduce this error. I still get the activation and forgot password email.

The eMail method (named "_writeMail") is located inside the class.users.php file and starts at line 325.

This method is called 3 times, and only in the class.users.php file:
line 741 - activation method
line 807 - activateUser method
line 916 - lostPassword method

Sincerely,
Sam.

Last edited by SamBrishes (2015-11-06 09:16)

Plugins: pawUsers (0.1.0)
AdminThemes: Fox (0.2.2) | WinT (0.4.0)
Projects: pawGFM Filter | pawAskMe | SnickerForum | [...]

Thumbs up

25

Re: Plugin: pawUsers

Hello,
I have played a little bit with the class.users.php and have added the following "mail-send" code which is used already in the fm_contact-plugin:

I have added the following code (line 382)

    $email->message($message);


    // try to send an email        
        $headers = 'From: xyz@t-online.de'."\r\n".
        'Reply-To: xyz@t-online.de'."\r\n" .
        'X-Mailer: PHP/5.5.29'. "\r\n".
        'MIME-Version: 1.0'. "\r\n".
        'Content-type: text/html; charset=iso-8859-1';            
            
    echo "Sendig email to your email Account.".'</br>';
        mail("webmaster@xyz.de", "TEST-Mail", $message, $headers); 
    // try to send an email

        
    if(@$email->send()){

Of course mai(.... is not checking if the mail is really going out.

(Have changed here the email-addresses)

Now I do get the email with the reactivation message - it is in $message.
I will use this as a workaround (have only to edit some fields), until the problem is solved.

So, the "normal mail" function on my server is working.
As far as I understand your code "use_helper("Email");" is not working.

Regards

Last edited by bongo (2015-11-06 11:23)

Thumbs up