1
Gestione e-commerce / Re:virtuemart SSL (Secure Sockets Layer) differenza tra ssl condiviso e dedicato
« il: 17 Mag 2013, 09:06:35 »
io capisco tutto ma nn è così semplice trovare im mezzo a tutti questi messaggi mi scrivi il link???
Questa sezione ti permette di visualizzare tutti i post inviati da questo utente. N.B: puoi vedere solo i post relativi alle aree dove hai l'accesso.
grazie
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of JUserImporter component
*/
class JUserImporterController extends JControllerLegacy
{
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = array())
{
// set default view if not set
$input = JFactory::getApplication()->input;
$input->set('view', $input->getCmd('view', 'JUserImporter'));
// call parent behavior
parent::display($cachable, $urlparams);
}
/**
* Import task
*/
function importUsers($source = "e:/xampp/htdocs/users2import.csv")
{
/* Check the user file exists */
/* Open the file */
if(!file_exists($source)) $source = $_REQUEST['srcfile'];
$handle = fopen($source,"r");
$content = fread ($handle,filesize ( $source ));
/* Get the file, line by line */
$lines = explode("\n", $content);
fclose($handle);
/* Counter of users added */
$added = 0;
/* Iterate through each line of the data file */
for ($i = 0; $i < count($lines); $i++){// as $key => $line){
/* Split the line by comma */
$properties = explode(",",$lines[$i]);
/* Build a new user object */
$user = new JUser();
$data = array();
$data['name'] = $properties[0];
$data['username'] = $properties[1];
$data['email'] = $properties[2];
$data['password'] = $properties[3];
// Load the users plugin group.
JPluginHelper::importPlugin('user');
/* Set the values */
$user->groups = array(2);
if (!$user->bind($data))
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError()));
return false;
}
$user->registerDate = date('Y-m-d H:i:s');
if (!$user->save())
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError()));
return false;
}
else $added++;
$user = null;
}
if($added) return $added;
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', "Ci sono stati degli errori nella importazione"));
return false;
}
}
/* Iterate through each line of the data file */
for ($i = 0; $i < count($lines); $i++){// as $key => $line){
/* Split the line by comma */
$properties = explode(",",$lines[$i]
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of JUserImporter component
*/
class JUserImporterController extends JControllerLegacy
{
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = array())
{
// set default view if not set
$input = JFactory::getApplication()->input;
$input->set('view', $input->getCmd('view', 'JUserImporter'));
// call parent behavior
parent::display($cachable, $urlparams);
}
/**
* Import task
*/
function importUsers($source = "e:/xampp/htdocs/users2import.csv")
{
/* Check the user file exists */
/* Open the file */
if(!file_exists($source)) $source = $_REQUEST['srcfile'];
$handle = fopen($source,"r");
$content = fread ($handle,filesize ( $source ));
/* Get the file, line by line */
$lines = explode("\n", $content);
fclose($handle);
/* Counter of users added */
$added = 0;
/* Iterate through each line of the data file */
for ($i = 0; $i < count($lines); $i++){// as $key => $line){
/* Split the line by comma */
$properties = explode(",",$lines[$i]);
/* Build a new user object */
$user = new JUser();
$data = array();
$data['name'] = $properties[0];
$data['username'] = $properties[1];
$data['email'] = $properties[2];
$data['password'] = $properties[3];
// Load the users plugin group.
JPluginHelper::importPlugin('user');
/* Set the values */
$user->groups = array(2);
if (!$user->bind($data))
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError()));
return false;
}
$user->registerDate = date('Y-m-d H:i:s');
if (!$user->save())
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError()));
return false;
}
else $added++;
$user = null;
}
if($added) return $added;
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', "Ci sono stati degli errori nella importazione"));
return false;
}
}
/* Iterate through each line of the data file */
for ($i = 0; $i < count($lines); $i++){// as $key => $line){
/* Split the line by comma */
$properties = explode(",",$lines[$i]
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of JUserImporter component
*/
class JUserImporterController extends JControllerLegacy
{
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = array())
{
// set default view if not set
$input = JFactory::getApplication()->input;
$input->set('view', $input->getCmd('view', 'JUserImporter'));
// call parent behavior
parent::display($cachable, $urlparams);
}
/**
* Import task
*/
function importUsers($source = "e:/xampp/htdocs/users2import.csv")
{
/* Check the user file exists */
/* Open the file */
if(!file_exists($source)) $source = $_REQUEST['srcfile'];
$handle = fopen($source,"r");
$content = fread ($handle,filesize ( $source ));
/* Get the file, line by line */
$lines = explode("\n", $content);
fclose($handle);
/* Counter of users added */
$added = 0;
/* Iterate through each line of the data file */
foreach ($lines as $line){
/* Split the line by comma */
$properties = explode(",",$line);
/* Build a new user object */
$user = new JUser();
$data = array();
$data['name'] = $properties[0];
$data['username'] = $properties[1];
$data['email'] = $properties[2];
$data['password'] = $properties[3];
// Load the users plugin group.
JPluginHelper::importPlugin('user');
/* Set the values */
$user->groups = array(2);
if (!$user->bind($data))
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_BIND_FAILED', $user->getError()));
return false;
}
/* Build the password */
$salt = JUserHelper::genRandomPassword(32);
$crypted = JUserHelper::getCryptedPassword( preg_replace("/\s/", "", strtolower($line[3])) , $salt);
$newpassword= $crypted . ':' . $salt;
$user->registerDate = date('Y-m-d H:i:s');
if (!$user->save())
{
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', $user->getError()));
return false;
}
else $added++;
}
if($added) return $added;
$this->setError(JText::sprintf('COM_USERS_REGISTRATION_SAVE_FAILED', "Ci sono stati degli errori nella importazione"));
return false;
}
}
$salt = JUserHelper::genRandomPassword(32);
$crypt = JUserHelper::getCryptedPassword($array['password'], $salt);
$array['password'] = $crypt . ':' . $salt;
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of JUserImporter component
*/
class JUserImporterController extends JControllerLegacy
{
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = array())
{
// set default view if not set
$input = JFactory::getApplication()->input;
$input->set('view', $input->getCmd('view', 'JUserImporter'));
// call parent behavior
parent::display($cachable, $urlparams);
}
/**
* Import task
*/
function importUsers($source = "D:/xampp/htdocs/users2import.csv")
{
/* Check the user file exists */
/* Open the file */
if(!file_exists($source)) $source = $_REQUEST['srcfile'];
$handle = fopen($source,"r");
$content = fread ($handle,filesize ( $source ));
/* Get the file, line by line */
$lines = explode("\n", $content);
fclose($handle);
/* Counter of users added */
$added = 0;
/* Iterate through each line of the data file */
foreach ($lines as $line){
/* Split the line by comma */
$properties = explode(",",$line);
/* Build a new user object */
$user = new JUser();
$user->name = $properties[0];
$user->username = $properties[1];
$user->email = $properties[2];
$user->password = $properties[3];
$user->id = null;
/* Set the values */
$user->groups = array(2);
require_once( JPATH_ROOT . "/libraries/joomla/user/helper.php" ); // Needed to create password
$salt = JUserHelper::genRandomPassword(32);
$crypted = JUserHelper::getCryptedPassword($pwd, $salt) . ':' . $salt;
$newpassword= $crypted . ':' . $salt;
$user->password = $newpassword;
$user->registerDate = date('Y-m-d H:i:s');
if(!$user->save()) JError::raiseError(500,$user->getError() );
else $added++;
}
if($added) return $added;
JError::raiseError(403, JText::_('Ci sono stati degli errori.'));
return false;
}
}
|
|