Forums / Developer / User Handling

User Handling

Author Message

Fabricio Guerrero

Thursday 24 March 2005 3:39:25 am

Hi,

Im pretty new to eZPublish but have being programming for years and have a new project to abroad.

Currently we're migrating a clients site to ezPublish. This clients current site counts with a user registration form and user area. Due to that this user registration consists with over 50fields we woluld like to divide the registration proccess. Upon signup the user would only be prompted to fill out about 10 fields. Later upon succesfully register and logon the user should be able to fill out other fields divided by categories(folders).

My question is this doable by creating classes with in the user class or must i create classes with in the content class and some how relate them with an user? I've being trying to do it by creating various small classes within user class but does not seem to work.

Any clue??

Regards,
Fabricio Guerrero

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Lex 007

Thursday 24 March 2005 3:47:42 am

Hi,

The quick and dirty solution I found was to override the user registration template with the following :

{set 
    aValid = array('first_name','last_name','user_account','user_birthdate','user_tel','user_fax','user_company','user_address','user_zip','user_city','user_subtype')
}

<form enctype="multipart/form-data"  action={"/user/register/"|ezurl} method="post" name="Register">

<div class="maincontentheader">
<h1>{"Register user"|i18n("design/standard/user")}</h1>
</div>

{section show=$validation.processed}

{section name=UnvalidatedAttributes loop=$validation.attributes show=$validation.attributes}
<div class="warning">
<h2>{"Input did not validate"|i18n("design/standard/user")}</h2>
<ul>
    <li>{$UnvalidatedAttributes:item.name}: {$UnvalidatedAttributes:item.description}</li>
</ul>
</div>
{section-else}
<div class="feedback">
<h2>{"Input was stored successfully"|i18n("design/standard/user")}</h2>
</div>
{/section}

{/section}


{section name=ContentObjectAttribute loop=$content_attributes sequence=array(bglight,bgdark)}
    {section show=$aValid|contains($ContentObjectAttribute:item.contentclass_attribute.identifier)}
        <input type="hidden" name="ContentObjectAttribute_id[]" value="{$ContentObjectAttribute:item.id}" />
        <div class="block">
        <label>{$ContentObjectAttribute:item.contentclass_attribute.name}</label><div class="labelbreak"></div>
        {attribute_edit_gui attribute=$ContentObjectAttribute:item}
        </div>
    {/section}
{/section}

<div class="buttonblock">
<input class="button" type="submit" name="PublishButton" value="{'Register'|i18n('design/standard/user')}" />
<input class="button" type="submit" name="CancelButton" value="{'Discard'|i18n('design/standard/user')}" />
</div>

</form>

aValid is the array of the attributes you want to show on registration ;)

Lex

Fabricio Guerrero

Thursday 24 March 2005 4:13:49 am

ok.. but sorry i did not explain my self correctly... the registration part ive got it done... i just update the original user class and made it have about 10 fields. but now i would like the user fill out the rest of the fields once he logs on... my first idea was to create new classes with in the user class.. but 4 some reason they're just not showing up... if i create them as content classes they show. but i assume i must create user classes so ezPublish can associate an User and all the little classes(additional info) i want to store for them...

or is there a way to associate an registered user(user class) with data collected by content classes?

Fabricio
pd: thanks for ur help anyway... it's sort of useful.. i can just create one HUGE class and show info according to my needs... as u say it's a dirty way but i'm sure ezPublush must have a cleaner way.... i hope.. ;)

http://www.solobromasychistes.com <<Joomla Site :P
http://www.recipesforhealthyfood.com/ <<Drupal Site :P
http://www.ezforge.com/ <<future ezCommunity, Articles, forums and more...

Lex 007

Thursday 24 March 2005 4:30:15 am

Then you could create a workflow type (on the "before content read" trigger) that checks if the user has a value for the newly created fields. If not, then the user is redirected to the "edit account" page.

Lex 007

Thursday 24 March 2005 4:53:37 am

OK, I found the problem ! I debugged the $query and found out that I don't have sufficient permissions in my cronjob to fetch the right nodes.

Now how to I login in a php cronjob ?

Patrick ALLAERT

Tuesday 19 July 2005 3:49:03 am

Lex 007,

Did you receive an answer about your question:
"how to I login in a php cronjob ?" ?

Regards

Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/

Patrick ALLAERT

Tuesday 19 July 2005 3:57:09 am

I love to reply to myself :)

// Loging in Admin user (ID: 14)
$admin =& eZUser::fetch( 14 );
$admin->loginCurrent();

Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/

eZ debug

Timing: Jan 18 2025 15:14:35
Script start
Timing: Jan 18 2025 15:14:35
Module start 'content'
Timing: Jan 18 2025 15:14:36
Module end 'content'
Timing: Jan 18 2025 15:14:36
Script end

Main resources:

Total runtime0.8772 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.9688180.8516
Module start 'content' 0.00640.7244 769.8203635.9219
Module end 'content' 0.73080.1463 1,405.7422345.0859
Script end 0.8772  1,750.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5062210.0002
Check MTime0.00140.1626210.0001
Mysql Total
Database connection0.00130.147310.0013
Mysqli_queries0.799991.18142080.0038
Looping result0.00210.24052060.0000
Template Total0.853697.320.4268
Template load0.00170.198520.0009
Template processing0.851997.111020.4259
Template load and register function0.00010.011210.0001
states
state_id_array0.00060.072710.0006
state_identifier_array0.00080.087820.0004
Override
Cache load0.00150.1751390.0000
Sytem overhead
Fetch class attribute can translate value0.00080.096740.0002
Fetch class attribute name0.00140.161090.0002
XML
Image XML parsing0.00120.135240.0003
class_abstraction
Instantiating content class attribute0.00000.0022120.0000
General
dbfile0.00370.4215330.0001
String conversion0.00000.000730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs