| Server IP : 195.130.67.5 / Your IP : 216.73.217.154 Web Server : Microsoft-IIS/10.0 System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586 User : IUSR ( 0) PHP Version : 7.4.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Old Sites/eadsa/administrator/components/com_jce/groups/ |
Upload File : |
<?php
class JCEGroupsHelper {
function getUserGroupFromId( $id ){
$db =& JFactory::getDBO();
$query = 'SELECT *'
. ' FROM #__jce_groups'
. ' WHERE '.$id.' IN (users)'
;
$db->setQuery( $query );
$groups = $db->loadObjectList();
return $groups[0];
}
function getUserGroupFromType( $type ){
$db =& JFactory::getDBO();
if(!is_int($type)){
$query = 'SELECT id'
. ' FROM #__core_acl_aro_groups'
. ' WHERE name = "'.$type.'"'
;
$db->setQuery( $query );
$id = $db->loadResult();
}
$query = 'SELECT *'
. ' FROM #__jce_groups'
. ' WHERE '.$type.' IN (types)'
;
$db->setQuery( $query );
$groups = $db->loadObjectList();
return $groups[0];
}
function getRowArray($rows){
$out = array();
$rows = explode(';', $rows);
$i = 1;
foreach($rows as $row){
$out[$i] = $row;
$i++;
}
return $out;
}
function getExtensions($plugin){
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$path = JCE_PLUGINS.DS.$plugin.DS.'extensions';
$extensions = array();
if (JFolder::exists($path)) {
$types = JFolder::folders($path);
foreach ($types as $type) {
$files = JFolder::files($path.DS.$type, '\.xml$');
foreach ($files as $file) {
$object = new StdClass();
$object->folder = $type;
$name = JFile::stripExt($file);
if (JFile::exists($path.DS.$type.DS.$name.'.php')) {
$object->extension = $name;
// Load xml file
$xml =& JFactory::getXMLParser('Simple');
if ($xml->loadFile($path.DS.$type.DS.$file)) {
$root =& $xml->document;
$name = $root->getElementByPath('name');
$object->name = $name->data();
} else {
$object->name = $name;
}
$extensions[] = $object;
}
}
}
}
return $extensions;
}
}