Step one: Create the website

Step one: Create the website

  • Use UCreate, select the wao file "Member with Yii2 RBAC", and click "Create Website"
  • Rename the URL and update the website
  • Disable the output of Yii2. Use ShortCut Yii2 -> yii2. This will reduce the update time.
  • default admin login:
    • user: admin
    • password:test1234

Optional step two: Add Google Login

  • Create a role at the website
    • Log in as admin to the website
    • Click the Admin page, click "New Roles"
  • To assign a user role
    • Log in as admin 
    • Click the edit icon to the right of a user
      • Click assignment
      • Select or delete items
      • Click Update assignment
  • Assign a role with access to a page
    • Log in to the management website
    • Go to level 5
    • For secondary navigation, use the layout screen to navigate to the target secondary page layout.
    • Navigate to Edit -> Menu -> EditMenu
    • Find the target page and click 
      • Enter the role and click AdddSessionVar
      • Assign as many roles as needed

Accessiable to an area

  • click UpdateModuleVar1
  • To make this area accessable to the role Member
  • At Multi-PreTagCode (inlcuded before id div) enter "<?php if (yii_check("Member")) { ?> "
  • At the Multi-EndTagCode (Included after closing id div) enter "<?php } ?> "

Customize logout

  • Use ShortCut: 3.3 Navigation -> Nav
  • Add record Right-Code and enter
         <?php 
            // Check if the user is logged in 
            if (!Yii::$app->user->isGuest) { 
               // Get the user identity object 
               $identity = Yii::$app->user->identity; 
               // Access the email attribute 
               $userEmail = $identity->email; 
               // Use the email address 
               echo '<ul class="list-group list-group-flush">'; 
               echo '<li class="list-group-item" style="padding: 3px 5px;font-size: 80%;"><span>'. $userEmail.'</span></li>'; 
               echo '<li class="list-group-item text-center " style="padding: 1px 5px;font-size: 80%;"><a href="/default/en-US/nav6h0/s/Logout/?r=site%2Flogout">&nbsp;&nbsp;Logout&nbsp;&nbsp;</a></li></ul>'; 
           }
         ?>