I had php provisioning scripts working on a centos 5 pc; then I had
to
reinstall it with fedora 9 and I install it as close as possible as
the centos 5, but the php scritps provisioning are now not
working....
I have 3 main files:
1. is the user data: name, lastname, nickname, userid, password, etc.
2. a shell script that parses the data file to the php file.
3. the php file that gets the token, creates accounts, etc.
here is the code:
::::::::::::::
final-create.alumni.jsums.edu1.txt
::::::::::::::
Name1 Lastname1 userid1 password1 nikename1
Name2 Lastname2 userid2 password2 nikename2
Name3 Lastname3 userid3 password3 nikename3
::::::::::::::
final-create.alumni.jsums.edu.php
::::::::::::::
#!/usr/bin/php4 -q
<?php
require_once("auth.php");
require_once("account.php");
require_once("alias.php");
require_once("mailing.php");
/* Example user name, alias name and mailing list name for the
demo.
*$source_data = "final-create.alumni.jsums.edu.txt";
*$user_name = $argv[1];
*$first_name = trim(`more '$source_data' |grep '$user_name' |awk
'{print $1}'`);
*$last_name = trim(`more '$source_data' |grep '$user_name' |awk
'{print $2}'`);
*$user_pass = trim(`more '$source_data' |grep '$user_name' |awk
'{print $4}'`);
*$alias_name = trim(`more '$source_data' |grep '$user_name' |awk
'{print $5}'`);
*$mailing_list_name = "occ";
*/
$domain = "alumni.jsums.edu";
/* Get an administrator token. */
print "Attempting to get token...\n";
$token = GetAuthToken("[EMAIL PROTECTED]", "adminpassword",
"", "");
print "Obtained token $token\n\n";
/* Create a new account.*/
print "Creating " . $user_name . "...\n";
print CreateAccountWithEmail($token, $domain, $first_name,
$last_name, $user_name, $user_pass) . "\n";
/* And an email alias. */
print "Giving " . $user_name . " email alias " . $alias_name .
"...
\n";
print CreateAlias($token, $domain, $user_name, $alias_name) .
"\n";
/* Add users to mailling lists.
* print "Adding " . $user_name . " to the list...\n";
* print UpdateMailingList($token, $domain, $mailing_list_name,
$user_name, "add") . "\n";
*/
?>
::::::::::::::
final-create.alumni.jsums.edu.sh
::::::::::::::
#!/bin/bash
more final-create.alumni.jsums.edu.txt | gawk '{print $3}' | xargs -
l1 /usr/bin/php final-create.alumni.jsums.edu.php
::::::::::::::
the scripts worked fine before the reinstall, now they don't even get
a token... out of a list of about 1000 users to be created, the code
might get 30 or 60... the rest I get errors like:
Creating userid1...
Unable to create account. (Unknown error)
Giving userid1 email alias nickname1
nickname1...
nickname1...
Unable to create alias. (Unknown error)
Attempting to get token...
Obtained token token stringgoes here
Creating userid2...
<?xml version="1.0" encoding="UTF-8"?>
<hs:rest
xmlns:hs="google:accounts:rest:protocol"><hs:status>Failure(2001)</
hs:status><hs:reason>InvalidData(1031)</hs:reason><hs:extendedMes
sage>No extended message available for this error.</
hs:extendedMessage><hs:result></hs:result><hs:type></hs:type></
hs:rest>
also I get instances where no token is ontained (with in the same
script)
Attempting to get token...
Obtained token
Creating userid2...
<?xml version="1.0" encoding="UTF-8"?>
<hs:rest
xmlns:hs="google:accounts:rest:protocol"><hs:status>Failure(2001)</
hs:status><hs:reason>AuthenticationFailure(1006)</
hs:reason><hs:extendedMessage>No extended message av
ailable for this error.</hs:extendedMessage><hs:result></
hs:result><hs:type></hs:type></hs:rest>
I know my userid admin and password are correct; I'm able to login to
my domains...
any ideas?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---