Excellent Point!
What about adding a field to easily insert custom Terms of use? A user should need to accept the Terms upon registering.
$displayRegisterTpl = isset($registerTpl) ? $modx->getChunk($registerTpl) : $wlpeRegisterTpl;
$modx->getChunk()fails as a result of missing chunk, $displayRegisterTpl remains empty... ( this goes for all chunks )
$lang = isset($lang) ? $lang : 'en'; include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php';
file_exists()function and error notification or at least falling back on the default ("en")
Nice catch! Looks like i need to wrap those in if blocks, unless you have a more efficient way of checking all the chunks to verify existence
Bravo!
Ideally, this param would accept doc_id or chunk name, else ignore. The "I Accept" checkbox should be either [pre|app]ended to the user defined agreement copy by WebLoginPE maybe?
Also, upon reviewing the code in webloginpe.snippet.php, there doesn’t seem to be any error checking for the following:
[*] Mis-typed or missing chunks (if a user defines a tpl chunk that doesn’t exist, WebLoginPE doesn’t seem to account for this [at least fall back on default TPLs?] )
$displayRegisterTpl = isset($registerTpl) ? $modx->getChunk($registerTpl) : $wlpeRegisterTpl;
If$modx->getChunk()fails as a result of missing chunk, $displayRegisterTpl remains empty... ( this goes for all chunks )
Oops, now that was just stupid of me. I had this snippet all ready to be shared before I realized I had hard coded, language specific strings in both the class and the snippet. the last thing I did before I uploaded this to the repository was strip out those strings and put them in a language file. I totally missed this sloppy error. thank you pixelchutes. I will implement your file_exists suggestion.
[*] Language file for non-English ("en") - It doesn’t appear there is error checking for the existence of the corresponding language file.
$lang = isset($lang) ? $lang : 'en'; include_once MODX_BASE_PATH.'assets/snippets/webloginpe/lang/'.$lang.'.php';
I would recommend use offile_exists()function and error notification or at least falling back on the default ("en")
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /home/**********/**********/html/assets/snippets/webloginpe/webloginpe.class.php on line 20 Fatal error: Cannot instantiate non-existent class: webloginpe in /home/**********/**********/html/manager/includes/document.parser.class.inc.php(748) : eval()'d code on line 58
It looks like maybe you are trying to run it on PHP 4.x. WebLoginPE will only run under php5 or above.
Thanks Scotty, sounds like a great Snippet.
Tried to install it but got the following error.... prob something I did (didn’t) do, but got any suggestions?