ridgedale

Members
  • Content Count

    127
  • Joined

  • Last visited

Community Reputation

15 Good

About ridgedale

  • Rank
    Sr. Member

Recent Profile Visitors

902 profile views
  1. ridgedale

    Thank you for your feedback @kongondo and insight. I think at this stage the solution in the short-term is to only allow superusers to create/edit/remove roles and enable just the user-admin and user-admin-all permissions for sitemanagers to allow them to be able to assign the roles pre-defined by superusers. It will also keep the administration simple for future supersusers. Thanks again to both of you for your assistance.
  2. ridgedale

    Update: I can see adding the permission-admin permission to the sitemanager role gives the sitemanager access to all site permissions effectively allowing him/her to create a superuser equivalent role. That is definitely not what I am aiming for. Is it possible to restrict the permissions the sitemanager can give/remove to those assigned to the sitemanager role? Otherwise are there any alternative suggestions as to how to restrict sitemanager access, so s/he does not have access to modules, templates, fields and logs, but can manage users, roles and permissions at their own level or below?
  3. ridgedale

    Hi @Robin S , Thank you again for your reply and detailed instructions. I am very conscious of the potential pitfalls. What I am aiming to achieve overall is that sitmanagers only have control to manage roles and assign permissions that are equal to and beneath their own assigned rights. I hope that makes sense. The reason for not allowing sitemanagers to be superusers in this particular instance is that it is a multi-site installation where we don't want sitemanagers creating/editing/deleting templates/fields/logs and/or installing modules. All the sites are effectively run using identical templates and modules. If we allow sitemanagers that level of control it will inevitably lead to an administrative nightmre for the superusers in the long run. I will delve deeper and look further into this. Many thanks again for your guidance.
  4. ridgedale

    Hi @Robin S , Thanks again for responding. What I was doing was following the guidelines provided here: https://processwire.com/api/user-access/permissions/#user-admin-permissions I had missed the following little nugget of information: Now that the sitemanager can add/remove users s/he still does not have any access to add/remove roles or assign permissions despite the role-admin permission having been added and assigned to sitemanager. The Role menu item is displayed but no sub-menus are available and no Permissions menu is displayed at all. Not sure what I'm doing wrong, now. Any guidance appreciated.
  5. Reference: PW 3.0.111 and uikit3 based site using the Regular-Master profile. I wonder if anyone might be able to point me in the right direction. I need to restrict the superuser role to overall administrators of a group of sites, but provide role and permission administration for the administrators of the individual sites. My searches unearthed the following thread: However, after having already created the sitemanager role and given site administrators the user-admin permission and having then created the role-admin permission and assigned that to the sitemanager role, the users with sitemanager permissions are able to see the Roles item under the Access menu of the backend but no submenu is displayed showing the Add Role option or any of the roles that the administrator should have access to. My intention is that the individual site adminstrators should have access to assign the guest and sitemanager roles (but not edit them) and be able to create roles with privileges beneath that of sitemanager. Any advice would be greatly appreciated.
  6. ridgedale

    For the record I managed to resolve the issue by using the following code: admin.php: <?php namespace ProcessWire; /** * Admin template just loads the admin application controller, * and admin is just an application built on top of ProcessWire. * * This demonstrates how you can use ProcessWire as a front-end * to another application. * * Feel free to hook admin-specific functionality from this file, * but remember to leave the require() statement below at the end. * */ session_start(); $upgradePage = $pages->get('/site-upgrade/'); if($upgradePage->maintenance && $user->isLoggedin() && $user->name !== $upgradePage->maintainer) { $session->logout(); $mntvar = $upgradePage->maintainer; $redirurl = "/mntadm.php?upgadm=" . $mntvar; $session->redirect($redirurl, false); exit; } require($config->paths->adminTemplates . 'controller.php'); with the code for the target mntadm.php file being: <?php session_start(); ?> <!DOCTYPE html> <html> <body> <?php echo "<p>This website is currently undergoing maintenance by " . $_GET['upgadm'] . ".</p>"; ?> </body> </html> Thanks again to everyone for their input.
  7. ridgedale

    Hi bernhard, Thank you for your reply. The maintainer field (located on the site-upgrade page within PW) holds the name of the person carrying out the maintenance. I'm trying to pass that name via (a) variable(s) to a page located outside PW. I don't want anyone other than the person carrying out the site maintenance logging into the site for the duration of the maintenance. Hopefully that clarifies things.
  8. ridgedale

    Thanks for the feedback, horst. Apologies. I'll try to bear that in mind in future.
  9. ridgedale

    Thank you again for your reply. Regarding: $upgradePage is the PW variable for the path to the page and maintainer is the field containing the data. Despite double-checking the PHP manual I can still not get the data passed between the pages. Below is the full relevant code: admin.php: <?php namespace ProcessWire; /** * Admin template just loads the admin application controller, * and admin is just an application built on top of ProcessWire. * * This demonstrates how you can use ProcessWire as a front-end * to another application. * * Feel free to hook admin-specific functionality from this file, * but remember to leave the require() statement below at the end. * */ session_start(); $upgradePage = $pages->get('/site-upgrade/'); if($upgradePage->maintenance && $user->isLoggedin() && $user->name !== $upgradePage->maintainer) { $session->logout(); $mntvar = $upgradePage->maintainer; $_SESSION["mntnrvar"] = $_SESSION["mntvar"]; $session->redirect("/mntadm.php", false); exit; } require($config->paths->adminTemplates . 'controller.php'); and the code for the target mntadm.php file is: <?php session_start(); ?> <!DOCTYPE html> <html> <body> <?php echo "<p>This website is currently undergoing maintenance by " . $_SESSION["mntnrvar"] . ".</p>"; ?> </body> </html> Everything works as intended apart from the maintainer data being passed.
  10. ridgedale

    Thanks for your reply @dragan . I've tried both the following with the same result of no output: admin.php: $mntvar = $upgradePage->maintainer; $_SESSION['mntnrvar'] = $mntvar; or: $mntvar = $upgradePage->maintainer; $_SESSION['mntnrvar'] = $_SESSION['mntvar']; and on the page redirected to: This website is currently undergoing maintenance by <?php echo($_SESSION['mntnrvar']); ?>. I'm not sure what I'm doing wrong.
  11. I am trying to pass a variable from ProcessWire to the outside world (for the purposes of page redirection). I've tried the following without any success: admin.php $session->mntnrvar = $upgradePage->maintainer; and on the page redirected to: <?php $mntnrvar = $session->mntnrvar; ?> This website is currently undergoing maintenance by <?php echo $mntnrvar; ?>. and: admin.php $mntvar = $upgradePage->maintainer; $GLOBALS['mntnrvar'] = $GLOBALS['mntvar']; and on the page redirected to: This website is currently undergoing maintenance by <?php echo $mntnrvar; ?>. In both cases $mntnrvar returns no data. The field is populated and the correct data is returned when called from within PW, but not when I try to pass the data outside of PW. Can anyone give me an idea where I am going wrong? Any assistance would be greatly appreciated.
  12. ridgedale

    @dragan / @adrian , I'm very wary about the compatibility and stability of both of the CustomPageRoles and PageEditPerUser modules both being proof of concept modules and appear to lack PW3 compatibility. Having read through the thread for the DynamicRoles module via the link @dragan provided I think I will look at @matjazp's fork as @adrian suggested. Albeit I do have reservations given @Robin S 's comments regarding the DynamicRoles module in the following thread: Although I'm not sure if those comments apply to one, the other or both of @ryan 's module and @matjazp's fork.
  13. ridgedale

    Thanks again for your assistamce, @dragan . Apologies. I realise that I have neglected to say that club users and entries administrators will have frontend access only. They only be submitting, checking and/or collecting data. Thank you for pointing out those modules. I'll look into them and see if they can help me get started.
  14. ridgedale

    Hi @dragan , Thanks for your feedback once again. Apologies, I should have spotted that. I can simplify home.php and _main.php as follows: home.php: <?php namespace ProcessWire; // this homepage template demonstrates making the headline, body and sidebar fields // editable on the front-end, using the <edit> tags ?> <div class='uk-margin-top' id='content-body'> <?php echo $modules->get("LoginRegister")->execute(); ?> </div> _main.php: <?php namespace ProcessWire; // _main.php template file, called after a page’s template file $home = pages()->get('/'); // homepage $siteTitle = 'Regular'; $siteTagline = $home->summary; ?><!DOCTYPE html> <html lang="en"> <head id='html-head'> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title id='html-title'><?=page()->title?></title> <meta name="description" content="<?=page()->summary?>"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/css/uikit.min.css" /> <link rel="stylesheet" href="<?=urls()->templates?>styles/main.css"> <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/uikit/3.0.0-beta.30/js/uikit-icons.min.js"></script> <?php if(page()->comments): ?> <script src='<?=urls()->FieldtypeComments?>comments.min.js'></script> <link rel="stylesheet" href="<?=urls()->FieldtypeComments?>comments.css"> <?php endif; ?> </head> <body id='html-body'> <!-- MASTHEAD --> <header class='uk-background-muted'> <div id='masthead' class="uk-container"> <h2 id='masthead-logo' class='uk-text-center uk-margin-medium-top uk-margin-small-bottom'> <a href='<?=urls()->root?>'> <img src='<?=urls()->templates?>styles/images/coffee4.svg' alt='coffee'><br /> </a> <?=$siteTitle?> </h2> </div> </header> <!-- MAIN CONTENT --> <main id='main' class='uk-container uk-margin uk-margin-large-bottom'> <?php if(page()->parent->id > $home->id) echo ukBreadcrumb(page(), [ 'class' => 'uk-visible@m' ]); ?> <div class='uk-grid-large' uk-grid> <div id='content' class='uk-width-expand'> <h1 id='content-head' class='uk-margin-small-top'> <?=page()->get('headline|title')?> </h1> <div id='content-body'> <?=page()->body?> </div> </div> <aside id='sidebar' class='uk-width-1-3@m'> <?=page()->sidebar?> </aside> </div> </main> <?php if(config()->debug && user()->isSuperuser()): // display region debugging info ?> <section id='debug' class='uk-section uk-section-muted'> <div class='uk-container'> <!--PW-REGION-DEBUG--> </div> </section> <?php endif; ?> <!-- FOOTER --> <footer class='uk-section uk-section-secondary'> <div id='footer' class='uk-container'> <div uk-grid> <div class='uk-width-1-3@m uk-flex-last@m uk-text-center'> <form class='uk-search uk-search-default' action='<?=pages()->get('template=search')->url?>' method='get'> <button type='submit' class='uk-search-toggle uk-search-icon-flip' uk-search-icon></button> <input type='search' id='search-query' name='q' class='uk-search-input' placeholder='Search&hellip;'> </form> </div> <div class='uk-width-2-3@m uk-flex-first@m uk-text-center uk-text-left@m'> <h3 class='uk-margin-remove'> <?=$siteTitle?> <small class='uk-text-small uk-text-muted'><?=$siteTagline?></small> </h3> <p class='uk-margin-remove'> <small class='uk-text-small uk-text-muted'>&copy; <?=date('Y')?> &bull;</small> <a href='https://processwire.com'>Powered by ProcessWire CMS</a> </p> </div> </div> </div> </footer> </body> </html> Yes, I do understand as you pointed out in the answer to my previous topic, but my concern now is that adding fields and permissions to the user template may have a negative impact for the entry administrators. I would definitely prefer to use PW3 mode rather than creating MySQL tables. I am trying to get my head round how to build the entries system and drafting out table lists seemed a good place to start. One big initial concern I have is protecting the pages and data behind the login, and, secondly, I'm wondering whether or not the only way the two different user interfaces (club users/entries administrator(s) - menus providing page/data access) is to have two separate PW3 installations driven from the same database. Some data needs to be editable and read only to the club users and vice versa for the entries administrator(s). Is it possible to hide pages from some users and not others to present different navigation interfaces? As examples: A User Profile page will need to be editable by both the club users and the entries administrator(s). I'm thinking it might be better to setup a separate User Profile template that incorporates the fields used by the User template and add any additional fields to the User Profile template. Am I over-thinking/over-complicating things? The data for the Athlete pages should only be editable by the club user, not the entries administrator(s) who only need(s) read only/data export access, In addition, the relevant athlete data should only be accessible to the particular club to whom the athlete belongs. I don't know if this is correct or even possible, but it seems to me that I need a login.php page sitting in from of two home.php pages (one for the club users and one for the entries administrator(s). Have you or any other member of the PW community had to setup something similar before? If so, would it be possible to outline how it was achieved?
  15. Reference: PW 3.0.62 and uikit3 based site using the Regular-Master profile. I have some further questions having read the following thread: and the demo registration page referred to. I'm looking to setup a login page with no registration capability for club users to add/upload/manage their athlete entries. The entries administrator will manage the club logins and have access to a different set of pages (including some of the same pages). The club users are to be automatically directed initially to their profile page to update any required further information such as contact details. All users are to be required to login by user name not email address - one user name per club. Forgotten passwords will need to be requested from the entries administrator. The entries administrator is to be directed initially to an entries status page where the accepted and unaccepted athlete entries are listed for each club. The entries administrator should not be required to complete any further profile information. Any failed logins are to be redirected back to the login page. Initially I have replaced code in home.php with the following: <?php namespace ProcessWire; // this homepage template demonstrates making the headline, body and sidebar fields // editable on the front-end, using the <edit> tags ?> <div class='uk-margin-top' id='content-body'> <?php echo $modules->get("LoginRegister")->execute(); ?> </div> The only page accessible to guests needs to be the login page. How can I prevent guests bypassing the login page to guess and access the other pages of the website? Unpublishing the pages denies access to all users. Is the only way to create separate templates and deny access to pages created with them for guests? In addition, the Register for an account link needs to be removed. At this point I've created a list of tables and fields that I think will be required for the entries system: The available menus are to be different for the club users and entries administrator(s): If I've understood correctly, I need to create a template for each of the following Add then create individual pages for each club, season, fixture, category, race and club athletes. When the club user accesses the Athletes page s/he needs to be able to either add entries individually or import them via .csv upload effectively creating individual pages for each of the athletes (children of Athletes page) directly linked and only visible to the club. As is probably clear I have never created anything like this before. I'd appreciate any advice/assistance to help me get started.