Hey Guys,
i have got a problem with the upload from usersfiles to differnt folders. My idea is to use the usertyps from JACL.
Every group should have his own folder. This is my current code:
If i call this file by a link, "echo $type;" gives me the jacl-group from the user wich is logged in back.
But while i'm trying to use this for my upload, the editor just take the standard path ($mosConfig_live_site.'/dateien/'.$type.'/';) without "$type".
Is here anyone who can help me?
Thx
sorry for this bad english....
i have got a problem with the upload from usersfiles to differnt folders. My idea is to use the usertyps from JACL.
Every group should have his own folder. This is my current code:
<?php global $Config; global $my; global $type; define(_VALID_MOS, "0"); require( '../../../../../../../globals.php' ); require_once( '../../../../../../../configuration.php' ); require_once( '../../../../../../../includes/database.php' ); require_once( '../../../../../../../includes/joomla.php' ); $mainframe = new mosMainFrame( $database, $option, '.' ); $mainframe->initSession(); $my = $mainframe->getUser(); $database->loadObject( $my ); $type = $my->usertype; echo $type; $expired_time = time() - $mosConfig_lifetime; $ip = md5($_SERVER['REMOTE_ADDR']); $sql ='select ips.session_id from #__session ips ' . 'join #__session uip on uip.session_id = ips.username ' . 'join #__users usr on usr.id = uip.userid ' . 'where ips.session_id =\'' .$ip . '\' and usr.gid > 18 ' . 'and uip.time > ' .$expired_time; $database->setQuery( $sql ); $ip_recorded_for_jusr = $database->loadResult(); if(isset($ip_recorded_for_jusr)) { $Config['Enabled'] = true; } else { $Config['Enabled'] = true; } $Config['UserFilesPath'] = $mosConfig_live_site.'/dateien/'.$type.'/'; $Config['UserFilesAbsolutePath'] = $mosConfig_absolute_path.'/dateien/'.$type.'/'; $Config['ForceSingleExtension'] = true ; $Config['SecureImageUploads'] = true; $Config['ConfigAllowedCommands'] = array('QuickUpload', 'FileUpload', 'GetFolders', 'GetFoldersAndFiles', 'CreateFolder'); $Config['ConfigAllowedTypes'] = array('File', 'Image', 'Flash', 'Media'); $Config['HtmlExtensions'] = array("html", "htm", "xml", "xsd", "txt", "js"); $Config['AllowedExtensions']['File'] = array('7z', 'aiff', 'asf', 'avi', 'bmp', 'csv', 'doc', 'fla', 'flv', 'gif', 'gz', 'gzip', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'ods', 'odt', 'pdf', 'png', 'ppt', 'pxd', 'qt', 'ram', 'rar', 'rm', 'rmi', 'rmvb', 'rtf', 'sdc', 'sitd', 'swf', 'sxc', 'sxw', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'vsd', 'wav', 'wma', 'wmv', 'xls', 'xml', 'zip'); $Config['DeniedExtensions']['File'] = array(); $Config['FileTypesPath']['File'] = $Config['UserFilesPath']; $Config['FileTypesAbsolutePath']['File']= $Config['UserFilesAbsolutePath']; $Config['QuickUploadPath']['File'] = $Config['UserFilesPath']; $Config['QuickUploadAbsolutePath']['File']= $Config['UserFilesAbsolutePath']; $Config['AllowedExtensions']['Image'] = array('bmp','gif','jpeg','jpg','png'); $Config['DeniedExtensions']['Image'] = array() ; $Config['FileTypesPath']['Image'] = $Config['UserFilesPath']; $Config['FileTypesAbsolutePath']['Image']= $Config['UserFilesAbsolutePath']; $Config['QuickUploadPath']['Image'] = $Config['UserFilesPath']; $Config['QuickUploadAbsolutePath']['Image']= $Config['UserFilesAbsolutePath']; $Config['AllowedExtensions']['Flash'] = array('swf','flv'); $Config['DeniedExtensions']['Flash'] = array() ; $Config['FileTypesPath']['Flash'] = $Config['UserFilesPath']; $Config['FileTypesAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath']; $Config['QuickUploadPath']['Flash'] = $Config['UserFilesPath']; $Config['QuickUploadAbsolutePath']['Flash']= $Config['UserFilesAbsolutePath']; $Config['AllowedExtensions']['Media'] = array('aiff', 'asf', 'avi', 'bmp', 'fla', 'flv', 'gif', 'jpeg', 'jpg', 'mid', 'mov', 'mp3', 'mp4', 'mpc', 'mpeg', 'mpg', 'png', 'qt', 'ram', 'rm', 'rmi', 'rmvb', 'swf', 'tif', 'tiff', 'wav', 'wma', 'wmv'); $Config['DeniedExtensions']['Media'] = array() ; $Config['FileTypesPath']['Media'] = $Config['UserFilesPath']; $Config['FileTypesAbsolutePath']['Media']= $Config['UserFilesAbsolutePath']; $Config['QuickUploadPath']['Media'] = $Config['UserFilesPath']; $Config['QuickUploadAbsolutePath']['Media']= $Config['UserFilesAbsolutePath']; ?>
If i call this file by a link, "echo $type;" gives me the jacl-group from the user wich is logged in back.
But while i'm trying to use this for my upload, the editor just take the standard path ($mosConfig_live_site.'/dateien/'.$type.'/';) without "$type".
Is here anyone who can help me?
Thx
sorry for this bad english....