Manthan Multi Seller Marketplace
Finally I have released marketplace extension for multi seller/vendor functionality and it is absolutely free marketplace extension.For more info click here
Magento blog post about observer,config and add to cart functionality
$uploader = new Varien_File_Uploader('fileinputname');
$uploader->setAllowedExtensions(array('jpg','jpeg','gif','png'));
$uploader->setAllowRenameFiles(false);
$uploader->setFilesDispersion(false);
$path = Mage::getBaseDir('media') .DS. 'foo'.DS ;
if(!is_dir($path))
mkdir($path, 0777, true);
$uploader->save($path, $_FILES['fileinputname']['name']);
$resources = Mage::getModel('admin/roles')->getResourcesList();
foreach($resources as $key=>$value)
{
echo $key."
"; // fetch each resource
}
print_r($resources); // get All resource list in an array
Mage::getModel('admin/rules') ->setRoleId(2) // 2 is supplier id ->setResources(array('admin/catalog','admin/catalog/products','admin/seller_dashboard','admin/system','admin/system/myaccount', 'admin/seller','admin/seller/orders','admin/seller/reviews')) ->saveRel();