Hi!
I would like to check certain variables once someone logs in. Like I want him to verify his personal data, I would set the corresponding variable to 0. When he logs in afterwards he would then be redirected to the correpsonding form where he would have to check if everything is up to date or not. My current solution does what I want, but it checks every time, meaning with every visit on any page, the status of those variables. Is there any way to include this within cms:process_login so that it'll happen only when he actually logs in?
I would like to check certain variables once someone logs in. Like I want him to verify his personal data, I would set the corresponding variable to 0. When he logs in afterwards he would then be redirected to the correpsonding form where he would have to check if everything is up to date or not. My current solution does what I want, but it checks every time, meaning with every visit on any page, the status of those variables. Is there any way to include this within cms:process_login so that it'll happen only when he actually logs in?
- Code: Select all
<cms:if k_logged_in >
<cms:if k_user_access_level lt '10'>
<cms:pages masterpage="users/index.php" id=k_user_id>
<cms:set user_verified_data=user_verify_data 'global'/>
<cms:set user_verified_training=user_verify_training 'global'/>
<cms:set user_verified_settings=user_verify_privacy 'global'/>
<cms:set user_verified_etiquette=user_etiquette 'global'/>
</cms:pages>
<cms:if user_verified_data != '1'>
<cms:if k_matched_route='edit_view_info'>
<cms:else/>
<cms:redirect url="<cms:route_link masterpage='users/index.php' 'edit_view_info' rt_slash='' />" />
</cms:if>
<cms:else_if user_verified_training != '1' />
<cms:if k_matched_route='edit_view_training'>
<cms:else/>
<cms:redirect url="<cms:route_link masterpage='users/index.php' 'edit_view_training' rt_slash='' />" />
</cms:if>
<cms:else_if user_verified_settings != '1' />
<cms:if k_matched_route='edit_view_account'>
<cms:else/>
<cms:redirect url="<cms:route_link masterpage='users/index.php' 'edit_view_account' rt_slash='' />" />
</cms:if>
<cms:else_if user_verified_etiquette != '1' />
<cms:if k_template_name='users/confirm-etiquette.php'>
<cms:else/>
<cms:redirect url="<cms:link masterpage='users/confirm-etiquette.php' />" />
</cms:if>
</cms:if>
</cms:if>
<ul id="loginopt">
<li class="sep-li">Hello <b><cms:show k_user_title/></b></li>
<li><a href="/users/profile/" class="sep-li">Profile</a></li>
<cms:if k_user_access_level ge '7' ><li><a href=".../couch/" class="sep-li">Couch</a></li></cms:if>
<li><a href="<cms:logout_link />">Logout</a></li>
</ul>
<cms:else />
<!-- show the login form -->
<cms:form method='post' anchor='0'>
<cms:if k_success >
<cms:process_login redirect="1"/>
</cms:if>
<ul id="loginform">
<h2>Login</h2>
<li><cms:input type='text' name='k_user_name' placeholder="Benutzer"/></li>
<li><cms:input type='password' name='k_user_pwd' placeholder="Passwort"/></li>
<li><input type="submit" value="Login" name="submit" class="small fit"/></li>
<cms:if k_error >
<li><font color='#be2226'><cms:show k_error /></font></li>
<cms:redirect url='.../users/login/' />
</cms:if>
</ul>
</cms:form>
</cms:if>