Jump to content

gebeer

Members
  • Posts

    1,554
  • Joined

  • Last visited

  • Days Won

    48

Everything posted by gebeer

  1. I t does have a title field in the template. Just renamed The Label there to "Login Name".
  2. OK, bummer. Blame on me not checking the source and stealing your time. Can I buy you a beer/soda/coffee? I'm using same menu code in a different project where no problems with menu rendering appeared so far. Actually I took the code from here. Found it: I had commented out a part in the rendering function that prevented displaying pages with children. Slapping myself hard now. Credits for solving this go to Soma.
  3. The profile page itself shows fine. But there should also be a menu item "Profiles" visible in the top menu bar next to "Home". when logged in as frontend user. That is my problem. I thought, too, that it wouldn't matter to have 2 different templates or only one. That was just the only difference that I noticed when comparing your settings to mine.
  4. my custom login definitely logs user in. You can see it on my def site which I pmed you details to.
  5. Thanks a ton! Only difference to my setup is that your login is through the default pw login page while mine is through the frontend.
  6. These are the access settings now for my Profiles page with template userprofiles The Profiles page still doesn't show in the menu, although it says in the settings: No - Pages may NOT not appear in searches/lists unless the user has access to view them My logged in user has role guest and frontend. Role frontend has these permissions: Sorry, I still can't see why the menu item would not be visible.
  7. I'll try harder first and get back here if I don't succeed. Thank you again for your help.
  8. That approach totally makes sense to me and fits my project requirements very well, especially since I also want to keep frontend users out from the admin area. My Profile page has guest view permissions removed. Only frontend user role is allowed to view it. But still it does NOT show up when frontend user is logged in. And I don't know why. You can see my role and template setup in my first post. So I guess something must still be wrong with my role/template access setup. Still lost on this one.
  9. Thank you Soma, for taking your time and explaining things that precisely. This really helped me to get a better understanding of the whole role and permissions concept. I will alter my frontend role like you suggested and add checks for $user->isLoggedin() && $user->hasRole("frontend") in my templates. If I get you correctly on the navigation render: It is expected behaviour that the Profile page does NOT show, right? So I need to render an extra users menu with links to their profile page and whatever else they need? Pls confirm. Thank you.
  10. Hi all, I'm struggling in putting together a process module. I want to trash all pages that belong to a specific user after the user has been deleted. I found one related thread by onjegolders where he is doing things the other way around. In my case I need a process module that hooks after user delete. And I would like to use the wire/modules/Process/ProcessPageTrash.module. It is my first time creating a pw process module. I have read through the basics of creating modules including the wiki article and looked at the code of ProcessPageTrash.module. But I'm having a hard time putting things together. This is what I've got so far: class ProcessCleanupUserPages extends Process { public static function getModuleInfo() { return array( 'title' => 'Cleanup User Data', 'version' => 0.1, 'summary' => 'Deletes all pages that where created by a user after user has been deleted', 'singular' => true, 'permanent' => false, 'permission' => 'user-admin', 'requires' => 'ProcessPageTrash', 'autoload' => "process=ProcessPageList", // What to add here - autoload only on user list page ); } public function init() { $this->users->addHookAfter('delete', $this, '___execute()'); // is this correct? } public function ___execute() { //get user ID $userID = $this->id or $event->id // How to get the user ID? //get all pages that were created by the deleted user $userPages = $pages->get("created_users_id={$userID}"); // syntax for trash pages - call module ProcessPageTrash on $userPages } protected function render() { // print out message to admin after pages are successfully trashed } } ?> I added comments with "???" where I don't know exactly what to do. Any help would be much appreciated. Thank you.
  11. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array and the error message in the backend disappears.
  12. The problem happened to be related to old session files that I transferred when moving to the new server. Once I deleted all session files in assets/sessions on the new server, PW picks up the $config->httpHosts array. The error message in the backend disappears and I can create users and save their passwords without problems.
  13. @netcarver I added the link to that post. @onjegolders The profiles page is neither unpuplished nor hidden. It's template "userprofile" has access rules defined as per screenshot I supplied in my original post. I'm using this function to loop out my navigation: function renderChildrenOf($pa, $output = '', $level = 0) { $output = ''; $level++; foreach ($pa as $child) { $atoggle = ''; $class = ''; if ($child->numChildren(true) && count($child->parents) == 1) { $class .= 'dropdown'; $atoggle .= ' class="dropdown-toggle" data-toggle="dropdown"'; } else if ($child->numChildren(true) && count($child->parents) > 1 ) { $class .= 'dropdown-submenu'; $atoggle .= ' class="dropdown-toggle"'; } else if ($child->numChildren(true) && $child->id != 1) { $class .= 'dropdown-menu'; } // Makes the current page and it's top level parent add an active class $class .= ($child === wire("page") || $child === wire("page")->rootParent) ? " active" : ''; $class = strlen($class) ? " class='" . trim($class) . "'" : ''; if ($child->numChildren(true) && count($child->parents) == 1) { Add Caret if have children $output .= "<li$class><a href='$child->url'$atoggle>$child->title <b class='caret'></b></a>"; } else if ($child->numChildren(true) && count($child->parents) > 1) { $output .= "<li$class><a tabindex='-1' href='$child->url'$atoggle>$child->title</a>"; } else { $output .= "<li$class><a href='$child->url'$atoggle>$child->title</a>"; } // If this child is itself a parent and not the root page, then render it's children in their own menu too... if ($child->numChildren(true) && $child->id != 1) { $output .= renderChildrenOf($child->children, $output, $level); } $output .= "</li>"; } $outerclass = ($level == 1) ? "nav navbar-nav navbar-right" : 'dropdown-menu'; return "<ul class='$outerclass'>$output</ul>"; }
  14. I'm on the road. Will.supply the link tomorrow.
  15. After moving the site to the new host I have specified the new domain in the config file. But it is not recognized by PW. What ever I assign to $config->http hosts array, I always get that error.
  16. If you are talking about include paths in my templates, they are all correct.
  17. Thanks. Actually that is not my idea. Got it from another thread here.
  18. Thanks for the hint. But again, which path statements? Never had issues before when moving sites.
  19. Which path statements do you mean? Are they stored in the DB or in some config file? Can't find anything related to paths in config.php.
  20. I don't want to bloat the standard user profile. That is why I store all additional user info in those profile pages.
  21. Hello, I have a similar case like described in bwakad's post. But I don't want to ask there since the post is already marked as solved. My site has users with role "frontend" assigned that can edit their user profiles and add stuff on the frontend. frontend role setup: The user profiles are all stored in pages with template "userprofile" That template has these access settings: All user profiles live under a page "Profiles" that also has the template "userprofile": Now I would expect that the "Profiles" page only appears in the menu when a user with role "frontend" is logged in. But the menu item does not get displayed. I'm also using the function to display bootstrap menu item but bwakad's workaround seems a bit awkward (excuse the pun ). Does PW just work that way or is my access and permission setup wrong somehow? And how do I get the "profiles" menu item displayed only to users with role frontend?
  22. Hi, On a 2.5 install I try to add a second super user. After adding and saving it with password assigned, It gets displayed with a strike through in the user list. When I then edit and save it again, I get this error: Missing required value Required password was not specified. But the password was entered already when I added the user. This is happening only on a clone of an install on my dev server. When I add the same user on my local environment, everything is working as expected. The install on the dev server is the same where I get the persistent httpHost error described in my other thread. Also the httpHost error message gets displayed twice, above the user list and on the very top: I have other PW installs on that server which are all running smoothly. Any pointers to a solution would be great. Thank you.
  23. Hi all, after moving a new 2.5 install to a different server, I always get this error message in the backend: Unrecognized HTTP host: 'subdomain.mydomain.tld' - Please update your $config->httpHosts setting in /site/config.php The entry in config.php contained the new domain when I installed. Then I set the entry to an empty array. $config->httpHosts = array(''); But the error still displays in the backend. How can I get rid of it?
  24. @quickjeff yes exactly. Frontend users should be totally ignorant of the admin in my usecase. @adrian great, thank you for that module! "Again what learned", like Lothar Matthäus, a german football player, once said
  25. It is logical. The PW API supplies method which we can use to render forms through the API. There are predefined input field types that we can use. @netcarver You're right. I added an issue on github.
×
×
  • Create New...