Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS
#64

[eluser]NightLion[/eluser]
hi, i'm from brazil, yesterday i'v downloaded ur system, and i played it a several minutes.

then i saw few improvements that could be done, the principal:

E.g: i have a website with a blog, then i have some people responsable to write on that blog, then i'v created a role to them, but, they need the url of the news admin to create posts, then i've made a function that verifies whats modules admin that role can access. then it shows on cpanel only the modules that they have access.
(unfortunately, i had to disable the module cache ;/ )

in User_lib.php:
Code:
function check_admin_access()
    {
        if (isset($this->user_data->role))
        {
            return (bool)$this->CI->users_m->getAdminAccess($this->user_data->role);
        }
        else
        {
            return FALSE;
        }
    }

in User_m.php
Code:
function getAdminAccess($role = 'user', $module = NULL)
    {
        $query = $this->db->getwhere('permission_roles', array('abbrev'=>$role));
        $row = $query->row();
        $role_id = $row->id;
        $this->db->where('permission_role_id',$role_id);
        $this->db->where('controller','admin');
        $this->db->where('method','*');
        if ($module)
            $this->db->where('module',$module);
        return $this->db->get('permission_rules')->num_rows();
    }

inside of getModules function in modules_m.php:
Code:
if (($this->users_m->getAdminAccess($this->user_lib->user_data->role, basename($module_name))) or ($this->user_lib->user_data->role == "admin"))
{
$modules[] = $module;
}

inside of the theme with the link with the Admin panel:
Code:
<? if( $this->user_lib->check_admin_access() ): ?>
| <?=anchor('admin', 'Admin Panel', 'target="_blank"'); ?>
<? endif; ?>

put if u want in PyroCMS, i dont know if u think useful, but i did.

Hugs from Brazil Big Grin

edit:I think its better create a forum/site/whatever to PyroCMS, then the "community" can help developing modules, fixing bugs, developing funcions, etc.
edit2:An improvement that could be done too it's a system of blocks, u said that u'll allow theme changes inside of the cpanel, then could be done a module to manage blocks of news/pool/whatever Big Grin


Messages In This Thread
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS - by El Forum - 05-03-2009, 05:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB