-
Posts
533 -
Joined
-
Last visited
Everything posted by adrianmak
-
simple but useful for e-commerce site
-
http://netdata.firehol.org/
-
It shown up now, by setting to development mode instead of detect mode
-
I downloaded the module and enabled. But there is no tracy debugger bar shown on the front-end
-
wireshell - an extendable ProcessWire command line interface
adrianmak replied to marcus's topic in API & Templates
It will be good to add list of modules (locally) available for enable -
First time to came across $options['pageStack'] this variable., as I could not find it mentioned in https://processwire.com/docs/ Is it a global pw's variable similar as other pw's api variable like $page, $pages, $templates and etc. Any more details of this variable ?
-
what template permission should I set for non-content pages ?
adrianmak replied to adrianmak's topic in General Support
I'll take a look of all the above suggestions. Thanks anyway -
For a big website, in PW contest, there might have many non-content pages. Non-content pages are referring to those, log-in, log-out, register, store-check-out and etc which are just a template container response to a front-end url path. As an site content editor, these pages are not necessary to show at back-end with this user role. These pages are meaningful to a site builder, site administrator What roles should I set on these templates, so that they cannot be see by a content editor at back-end
-
how to compare a password for changing password ?
adrianmak replied to adrianmak's topic in API & Templates
Honestly, the pw's api doc is pretty out-dated. There many stuffs didn't said in api doc. For instance, $users variable -
I'm going to build a form for front-end user password changing. There should be three input fields current password new password confirm new password I knew that, password stored in database is hashed. How could I compare the input current password with the password stored in database ?
-
redirect to last/previous page after user log-in
adrianmak replied to adrianmak's topic in General Support
it's still not working. The same as using echo. After logged in, the page stay at login form, instead of go back to last page -
Any how to config from not using apache user account ? I';m testing in vm linux box I set the from as $mail->from('noreply@mydomain.com', 'No-Reply'); However the mail send from as www-data@mydomain.com
-
From the OP, should I have to create a activation page template ?
-
redirect to last/previous page after user log-in
adrianmak replied to adrianmak's topic in General Support
it didn't work. After logged in, the page stay at login form, instead of go back to last page -
redirect to last/previous page after user log-in
adrianmak replied to adrianmak's topic in General Support
I'm sorry. I could not follow This is my full code of login.php <?php $content = ""; if ($input->post->user && $input->post->pass) { $username = $sanitizer->username($input->post->user); $password = $input->post->pass; try { if ($session->login($username, $password)) { $session->redirect($pages->get("template=home")->url); // redirect to home after user login } else { $error = "Wrong username or password. Login failed."; } } catch (Exception $e) { $error = $e->getMessage(); } } $content .= " <div class='login-box'> <div class='panel panel-default'> <div class='panel-heading'> <h3 class='panel-title'><span class='lock-icon'></span><strong>Member Log-in</strong></h3> </div> <div class='panel-body'> <form role='form' action='./' method='post'> <div class='message-error'>$error</div> <div class='form-group'> <label for='user'>Username</label> <input type='text' name='user' id='user' class='form-control' placeholder='Username' /> </div> <div class='form-group'> <label for='pass'>Password</label> <input type='password' name='pass' id='pass' class='form-control' placeholder='Password' /> </div> <button type='submit' class='btn btn-sm btn-primary'>Login</button> </form> </div> </div> </div> "; Should I replace the code $session->redirect($pages->get("template=home")->url); // redirect to home after user login With echo "<script>history.go(-1);</script>"; ? -
Some page required certain role to access, and will redirect to a user log-in page I found this post, it handle the redirection manually, which could allow to store page id to session variable or redirect url with paramater. https://processwire.com/talk/topic/6387-redirect-to-previous-page/ However, I config the page redirect in template access tab, which I put log-in page id where a page redirection. Any clue to store a page with this method ?
-
Here is a sample page tree and my site is a multi language website with default English and two other languages let say japanese and korean language path suffix of each are / english /jpn japanese /kor korean Home +-----about +-----product +-----contact +-----members-area +-----login (1001) +-----logout (1002) members-area is restricted for users with registered role. In access tab of members-area template, page will redirect to 1001 page id (login form) for guest After user log in, it will redirect back to home My problem is if I am at other two langauges to login, it will redirect to default English home. I suppose redirect back to japanese home or korean home For instance, when access members area in japanese , http://mydomain.com/jpn/members-area it will redirect to login page http://mydomain.com/jpn/login After user logged in, pw redirect to (default English home) instead of http://mydomain.com/jpn (japanses Home) This is my login.php template <?php $content = ""; if ($user->isLoggedin()) { $session->redirect($pages->get("template=home")->url); } if ($input->post->user && $input->post->pass) { $username = $sanitizer->username($input->post->user); $password = $input->post->pass; try { if ($session->login($username, $password)) { $session->redirect($pages->get("template=home")->url); // redirect to home after user login } else { $error = "Wrong username or password. Login failed."; } } catch (Exception $e) { $error = $e->getMessage(); } } $content .= " <div class='login-box'> <div class='panel panel-default'> <div class='panel-heading'> <h3 class='panel-title'><span class='lock-icon'></span><strong>Member Log-in</strong></h3> </div> <div class='panel-body'> <form role='form' action='./' method='post'> <div class='message-error'>$error</div> <div class='form-group'> <label for='user'>Username</label> <input type='text' name='user' id='user' class='form-control' placeholder='Username' /> </div> <div class='form-group'> <label for='pass'>Password</label> <input type='password' name='pass' id='pass' class='form-control' placeholder='Password' /> </div> <button type='submit' class='btn btn-sm btn-primary'>Login</button> </form> </div> </div> </div> ";
-
How do i remove system flag of a template ?
adrianmak replied to adrianmak's topic in General Support
I see....... -
How do i remove system flag of a template ?
adrianmak replied to adrianmak's topic in General Support
$t = $templates->get("dashboard"); $t->flags = Template::flagSystemOverride; $t->flags = 0; Not working.....template's system flag is still checked ps I just put these few line of codes on home.php template and executed on home page -
A template checked with System flag, it cannot be viewable at the front-end. How could I disable system flag for a custom template ? I tried following code, but it didn't work $t = $templates->get("dashboard"); $t->set("flagSystem", 0); $t->save(); The system flag of dashboard template is still checked.
-
Let say Home +---about +---contact +---services +---member +---page1 +---page2 +---page3 member is using member template page1,2,3 are using basic-page template basic-page template can be viewed by guest user member template can be viewed by user which is with role of registered Are page1,2,3 inheritance the access role permission from member ? In other words, guest user cannot able to access page1,2,3
-
How to create a new user in api with multiple template or parent
adrianmak replied to adrianmak's topic in General Support
Before I got your suggested answer, I tested with $u->template = "my-user-parent"; and it work. I also tested with yours. it work too. -
Follw up with my previous post https://processwire.com/talk/topic/12782-regarding-multiple-templates-or-parents-for-users/ For default installation, api to create a new user is something like that $u = new User(); $u->of(false); $u->name = "adrian"; $u->email = "adrian@example.com"; $u->pass = "123456"; $u->addRole("registered"); $u->save(); $u->of(true); With multiple template or parent , how to setup a user object to use which template and parent, before executing save() method ?
-
regarding Multiple templates or parents for users
adrianmak replied to adrianmak's topic in General Support
I followed the steps of creating multiple template/parents for users I got an error on Step 4 while creating a new page with new template created in step 3. When I hitted save button, an error occur. Error: Call to a member function getInputfield() on a non-object (line 630 of /var/www/html/pw-test/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module) This error only occur when selecting the new created template. template (basic-page)from installation profile (basic profile) has no such an issue Edit: I'm sorry for my carelessness. I did something wrong on step 3 which producing the above error. Anyway, multiple template and parent setup for users is working now.