Author Topic: Bulk User Alternative Method  (Read 2183 times)

jcorona

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Bulk User Alternative Method
« on: February 11, 2010, 11:31:07 pm »
After being frustrated with the current method of adding bulk users, using this method:
http://trac.ebox-platform.com/wiki/Document/HowTo/ImportUsersInBulk

I found the following url to work to add one new user:

https://192.168.1.x/ebox/UsersAndGroups/AddUser?username=userName&name=firstName&surname=lastName&comment=someComments&password=somePassword&repassword=somePassword&group=someGroup&add=Add

I made an excel sheet to concatenate all the user info to this url and manually pasted the url for each user. If anyone really needs to make bulk users they can create a loop to open the url in firefox/chrome/etc.


Thanks,
-- Jorge

fbravod

  • Zen Apprentice
  • *
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Re: Bulk User Alternative Method
« Reply #1 on: February 26, 2010, 09:07:50 pm »
i used this script with php for create users with your idea
-------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
  <title>Crear usuarios en Ebox</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="GENERATOR" content="Quanta Plus KDE">
</head>
<body bgcolor="#ffffff" text="#000000">
<table style="border: 2px dotted gray;margin-right:auto;margin-left:auto;">
<?

$lines = file('alumnos');

?>

<tr style="text-align:center;background-color:#4a6890;color:#fff;">
<td>Usuario</td><td>Contrasenia</td><td>Nombre1</td><td>Nombre2</td><td>Apellido1</td><td>Apellido2</td></tr>
<?
foreach ($lines as $line_num => $line) {
        
        
$datos = explode(",", $line);
?>      
        <tr>
        <td> <?= $datos[0] ?></td>
        <td style="background-color:#cccccc;"> <?= $datos[1] ?></td>
        <td> <?= $datos[2]  ?></td>
        <td style="background-color:#cccccc;"> <?= $datos[3] ?></td>
        <td> <?= $datos[4]  ?></td>
        <td style="background-color:#cccccc;"> <?= $datos[5] ?></td>
        <IFRAME src="https://ip_ebox/ebox/UsersAndGroups/AddUser?username=<?= $datos[0] ?>&name=<?= $datos[2]." ".$datos[3] ?>&surname=<?= $datos[4]." ".$datos[5] ?>&comment=Alumnos&password=<?= $datos[1] ?>&repassword=<?= $datos[1] ?>&group=alumnos&add=Add
        " width="1" height="1"
  scrolling="auto" frameborder="1">
</IFRAME>
        </tr>
<?      
        } //fin foreach
?>
</table>

</body>
------------------------

where file alumnos contain
user,id,name1,name2,surname1,surname2

i put this file in /var/www/some_name.php and execute http:/ip_ebox/some_name.php and voila!!! works fine
« Last Edit: February 26, 2010, 09:12:42 pm by fbravod »