Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi!

Following issue:

I'm using extended users and would like to have new users verify their email address (as in the documentation). However my ultimate goal is not to activate the account directly (and additionally send an email to the admin).

So I changed the "activate" part to the following:

Code: Select all
<cms:if action='activate' >

   <h2>Activate account</h2>

   <cms:process_activation />

   <cms:if k_success >

      <cms:set_flash name='success_msg' value='2' />

      <cms:pages masterpage='users/index.php' id=page_id limit='1'>

      <cms:db_persist
         _masterpage=k_template_name
         _page_id=k_page_id
         _mode='edit'

         k_publish_date = '0000-00-00 00:00:00'
      />

      </cms:pages>

   <cms:else />

      <cms:show k_error />

   </cms:if>

<cms:else/>[...]


The process_activation seems to give me the page_id of the new registered user which is why I used cms:pages to access this user's details in hopes of sending those to the admin and resetting the publish date to zero so that the account gets disabled again. However I get only a "Cheating?!" when I try to open the verification link.

Any ideas to why? Or is there a better way to handle what I would like to achieve?

No solution on this one? When searching I could only find that "cheating?!" happens when trying to change user access levels - but I'm not doing this...

Hi,

You mentioned -
The process_activation seems to give me the page_id of the new registered user

From what I could gather, I don't think there is any direct way of getting the page_id of the user at that particular point in the activation process. Without a valid page_id, your existing code is most likely fetching the first page it finds in the user template.

Also please remember that when your code is executing, the visitor is an anonymous entity (not yet logged-in) and so
whatever user account is being fetched cannot be 'enabled' or 'disabled' by her - ergo the 'Cheating' message.

I don't have a solution at hand for your use-case, I am sorry.
I'll have to study how things work to get one so please grant me little time (and feel free to ping me if you find me taking too much time :) )

Hi KK,

thanks for the answer! I'm only left wondering what process_activation is then doing exactly. How does it know which page/user is to be enabeld?

How does it know which page/user is to be enabeld?

That info is contained in the 'activation key' :)
5 posts Page 1 of 1