1
ccrstudioweb
Re: subgroup may administrate the admin group?

I think this solution works for me, in my case: I have only one admin and five groups. I tested the system using the diferents groups and everything is ok now. As I had no idea how to restrict this kind of access I opened this post. So This may be a REFERENCE only.
Ghia thank you for the help and the tip about creating other references/routines beyond the originals. I´m using them in other situations! Once I´m not so good in php, these are gold.
Thank You!
My Google Maps API3 and Xoops integration (Cool!):
http://www.esterecomendo.com.br/portal/



2
ccrstudioweb
Re: subgroup may administrate the admin group?

Let me update the solution:
kernel/group.php
if (isset($criteria) && is_subclass_of($criteria'criteriaelement')) {
            
$sql .= ' '.$criteria->renderWhere();
            
$limit $criteria->getLimit();
            
$start $criteria->getStart();
        }

to:
if (isset($criteria) && is_subclass_of($criteria'criteriaelement'))
 {
            
$sql .= ' '.$criteria->renderWhere();
            
$limit 4;//number of itens in droplist
            
$start 1;//it gives groups 2,3,4,.... except ADMIN      }

and
System/admin/users/userform.php
Here I gave in ADMIN AREA to group SELECIONADOR no rights to edit groups, only users. So XOOPS give an automated dropdown lis of the groups name.
else {
    foreach (
$groups as $key => $group) {
    
$group_select[] = new XoopsFormHidden('groups[' $key 
']'$group);            
    }

So I changed the former code to the folowing, forcing the COLABORADOR to see the group´s name dropdownlist.
Added a condition $uid_value == '1' in order to COLABORADOR not see ADMIN´s group´s name dropdownlist. Admin continue to see all (global):
else {
if (
$uid_value == '1') {$group_select[] = new 
XoopsFormHidden('groups[' $key ']'$group);    } else 
{
$group_select[] = new XoopsFormSelectGroup('<font 
style="font-size: 17px; color: #A65700">
(!)'
._US_GROUPS.'</font>''groups'false$groups5true);}}



3
ccrstudioweb
Re: subgroup may administrate the admin group?

Hi Ghia,
I´ve found!

In kernel/groups.php I change from:

/**
     * retrieve groups from the database
     * @param object $criteria {@link CriteriaElement} with conditions for the groups
     * @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
     * @return mixed Array of groups
     */

   
function getObjects($criteria null$id_as_key false)
    {
        
$ret = array();
        
$limit $start 0;
        
$sql 'SELECT * FROM '.$this->db->prefix('groups');
        if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) {
            
$sql .= ' '.$criteria->renderWhere();
            
$limit $criteria->getLimit();
            
$start $criteria->getStart();
        }
        
$result $this->db->query($sql$limit$start);
        if (!
$result) {
            return 
$ret;
        }
        while (
$myrow $this->db->fetchArray($result)) {
            
$group = new XoopsGroup();
            
$group->assignVars($myrow);
            if (!
$id_as_key) {
                
$ret[] =& $group;
            } else {
                
$ret[$myrow['groupid']] =& $group;
            }
            unset(
$group);
        }
        return 
$ret;
    }*/



to:



/**
     * retrieve groups from the database
     *
     * @param object $criteria {@link CriteriaElement} with conditions for the groups
     * @param bool $id_as_key should the groups' IDs be used as keys for the associative array?
     * @return mixed Array of groups
     */

function getObjects($criteria null$id_as_key false)
    {
        
$ret = array();
        
$limit $start 0;
        
$sql 'SELECT * FROM '.$this->db->prefix('groups');
        if (isset(
$criteria) && is_subclass_of($criteria'criteriaelement')) {
            
$sql .= ' '.$criteria->renderWhere();
////////////////////HERE///////////////////////
            
$limit 4;
            
$start 1;
/////////////////////////////////////////////////
        
}
        
$result $this->db->query($sql$limit$start);
        if (!
$result) {
            return 
$ret;
        }
        while (
$myrow $this->db->fetchArray($result)) {
            
$group = new XoopsGroup();
            
$group->assignVars($myrow);
            if (!
$id_as_key) {
                
$ret[] =& $group;
            } else {
                
$ret[$myrow['groupid']] =& $group;
            }
            unset(
$group);
        }
        return 
$ret;
    }


As you are one xoops especialist, do you think this change may
alternate some function?

Thank you!
My Google Maps API3 and Xoops integration (Cool!):
http://www.esterecomendo.com.br/portal/



4
ccrstudioweb
Re: subgroup may administrate the admin group?

I think is possible to hide some groups changing the /class/xoopsform/formselectgroup.php

I´m trying here...



5
ccrstudioweb
Re: Problem with entities in the title of a page

If the table mysql is saving it right, the problem is when reading it.
Have you tried to change in theme.html from

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />

to


<meta http-equiv="content-type" content="text/html; charset=UTF-8" />



6
ccrstudioweb
Re: subgroup may administrate the admin group?

Each group has an g_id=1, 2,...
How can I tell the PHP to omit some g_ids in the array groups?



7
ccrstudioweb
Re: subgroup may administrate the admin group?

The line for the select item:
modules/system/admin/users/userform.php line 168:

$group_select[] = new XoopsFormSelectGroup('<font style="font-size: 17px; color: #A65700">(!)'._US_GROUPS.'</font>''groups'false$groups5true);


It generates this:

<tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption"><span class="caption-text"><font style="font-size: 17px; color: rgb(166, 87, 0);">(!)Grupos de Usuários</font></span><span class="caption-marker">*</span></div></td><td class="even"><select size="5" name="groups[]" id="groups[]" multiple="multiple">
<
option value="1">ADMINISTRATOR</option>
<
option value="2" selected="selected">USER</option>
<
option value="5">SELECIONADOR</option>
<
option value="6">COLABORADOR</option>
<
option value="7">ALUNO</option>
<
option value="9">PROFESSOR</option>
</
select></td></tr>



8
ccrstudioweb
subgroup may administrate the admin group?

Xoops 2.0.18

Hi,
I went throught an interesting issue:
I create a group called SELECIONADOR and gave it the permission to manage groups, I mean, when a visitor register, he give some information in order to be alocated by SELECIONADOR to especific group: ALUNO, PROFESSOR or COLABORADOR.

So SELECIONADOR enters admin>>edit user and activate this new user, after SELECIONADOR check out the information given by visitor and alocate this user to the new group.

The problem is in *choose the group*:
Instead this:
ADMINISTRATOR
USER
SELECIONADOR
COLABORADOR
ALUNO
PROFESSOR

I want this:
USER
SELECIONADOR
COLABORADOR
ALUNO
PROFESSOR

I don´t want SELECIONADOR the option to create a new ADMINISTRATOR

Any help is welcome!



9
ccrstudioweb
Re: integer to date format

Thank you Mazar!
I used this:
date("Y-m-d"strval($row["created"]))



10
ccrstudioweb
integer to date format

Hi,
I could´t find answer.
I made a script that call some "news module" data.
The problem is about date:
I have something like "1234567890" instead of "19 de fevereiro de 2009".

How can I convert integer to my date format?
I´v found about intvar, strval, but I cound´t discovery how to use it....

$result mysql_query("SELECT * FROM 3b5s_stories ORDER BY -storyid"); if($row mysql_fetch_array($result)){ 
$dada $row["created"];   
echo 
$dada// returns "1234567890" instead of "19 de fevereiro de 2009" 
...
}


Any help is very welcome!




TopTop
(1) 2 3 4 ... 6 »



Login

Who's Online

254 user(s) are online (153 user(s) are browsing Support Forums)


Members: 0


Guests: 254


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits