chetans9 / core-php-admin-panel

An Admin panel written in core php with CRUD, filters and pagination.
http://freecs9.epizy.com/core-php-admin
283 stars 141 forks source link

Need to register user page #30

Closed mahdi5574 closed 3 years ago

mahdi5574 commented 4 years ago

Hi. Thanks for your great code. I need a register page for users. How can I add this page?

peixespnsc commented 4 years ago

Hi @mahdi5574 , I'm not sure what you ask, but after you login, go to /admin_users.php Your "admin_type" must to be "super" to have access to this page

mahdi5574 commented 4 years ago

Hi. I need user registration page with your code.

On Sun, Mar 29, 2020 at 3:28 PM Felipe Abranches de Araujo Porto < notifications@github.com> wrote:

Hi @mahdi5574 https://github.com/mahdi5574 , I'm not sure what you ask, but after you login, go to /admin_users.php Your "admin_type" must to be "super" to have access to this page

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chetans9/core-php-admin-panel/issues/30#issuecomment-605618385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6N7R6DY2XGC6MKELSI4T3RJ4SUPANCNFSM4LVJBV2Q .

felipeabranches commented 4 years ago

You mean this code https://github.com/chetans9/core-php-admin-panel/blob/master/admin_users.php?

mahdi5574 commented 4 years ago

No. I mean a user (not admin) can register himself without admin privileges from a registration link such as this: mywebsite.com/user_register.php . And second question is : how can I limit left menu items to some admins ?

On Fri, Apr 17, 2020 at 4:05 PM Felipe Abranches notifications@github.com wrote:

You mean this code https://github.com/chetans9/core-php-admin-panel/blob/master/admin_users.php ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chetans9/core-php-admin-panel/issues/30#issuecomment-615196572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6N7R2XTTSQNNJ3YE5EULLRNA5H3ANCNFSM4LVJBV2Q .

felipeabranches commented 4 years ago

In this branch https://github.com/peixespnsc/core-php-admin-panel you can register users without Superadmin or Admin privileges, but there isn't a form where a user can register himself yet. There's also the possibility to create others users' groups and change their privileges.

To limit the access of some menu itens (whit the forementioned forked below) you need to check the user's group, like this:

<?php if ($_SESSION['id_group'] == 2 || $_SESSION['id_group'] == 3): ?>
<!-- Only Moderator and Administrator groups have access -->
<li>
    <a href="#"><i class="fa fa-users fa-fw"></i> Users<i class="fa arrow"></i></a>
    <ul class="nav nav-second-level">
        <li><a href="<?php echo $base_url; ?>/users/accounts.php"><i class="fa fa-list fa-fw"></i> Accounts</a></li>
        <li><a href="<?php echo $base_url; ?>/users/groups.php"><i class="fa fa-list fa-fw"></i> Groups</a></li>
    </ul>
</li>
<?php endif; ?>
mahdi5574 commented 4 years ago

thanks for your great help. I created a column in users table and named it GID. And I defined $_SESSION['GID'] = $row['GID']; in login.php. after run your code I got this erro: " Notice: Undefined index: GID in C:\xampp\htdocs\abfa\includes\header.php on line 83 line 83 in header.php is: <?php if ($_SESSION['GID'] == 0 || $_SESSION['GID'] == 2): ?>

On Mon, Apr 27, 2020 at 3:52 PM Felipe Abranches notifications@github.com wrote:

In this branch https://github.com/peixespnsc/core-php-admin-panel you can register users without Superadmin or Admin privileges, but there isn't a form where a user can register himself yet. There's also the possibility to create others users' groups and change their privileges.

To limit the access of some menu itens (whit the forementioned forked below) you need to check the user's group, like this:

<?php if ($_SESSION['id_group'] == 2 || $_SESSION['id_group'] == 3): ?>

  • Users
  • <?php endif; ?>

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chetans9/core-php-admin-panel/issues/30#issuecomment-619918378, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6N7R664AYW5SGTN44UIA3ROVTH7ANCNFSM4LVJBV2Q .

    felipeabranches commented 4 years ago

    Try to define $_SESSION['GID'] = $row['GID']; in authenticate.php file too, on line 24. Tell me if it works

    mahdi5574 commented 3 years ago

    Hi. Thanks again for your code (php dashboard). I need to change form validation error messages. exactly this error: "Please fill out this field." Thanks a lot

    On Mon, Dec 21, 2020 at 2:33 PM Chetan Shenai @.***> wrote:

    Closed #30 https://github.com/chetans9/core-php-admin-panel/issues/30.

    — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/chetans9/core-php-admin-panel/issues/30#event-4135476831, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6N7RY6FZNNOH44AXGQUNDSV4TPFANCNFSM4LVJBV2Q .