[freeside-commits] freeside/fs_selfservice/php freeside.login_example.php, 1.1, NONE freeside_agent_login_example.php, NONE, 1.1 freeside_agent_new_customer_example.php, NONE, 1.1 freeside_agent_signup_example.php, NONE, 1.1 freeside_login_example.php, NONE, 1.1 process_login.php, 1.1, 1.2
Ivan,,,
ivan at wavetail.420.am
Wed Sep 14 09:09:24 PDT 2011
Update of /home/cvs/cvsroot/freeside/fs_selfservice/php
In directory wavetail.420.am:/tmp/cvs-serv5221
Modified Files:
process_login.php
Added Files:
freeside_agent_login_example.php
freeside_agent_new_customer_example.php
freeside_agent_signup_example.php freeside_login_example.php
Removed Files:
freeside.login_example.php
Log Message:
don't lowercase password
--- NEW FILE: freeside_agent_new_customer_example.php ---
<?
require('freeside.class.php');
$freeside = new FreesideSelfService();
$session_id = $_POST['session_id'];
$response = $freeside->new_customer( array(
'session_id' => $session_id,
'first' => $_POST['first'],
'last' => $_POST['last'],
'address1' => $_POST['address1'],
'address2' => $_POST['address2'],
'city' => $_POST['city'],
'state' => $_POST['state'],
'zip' => $_POST['zip'],
'country' => 'US',
'daytime' => $_POST['daytime'],
'fax' => $_POST['fax'],
'payby' => 'BILL',
'invoicing_list' => $_POST['email'],
'pkgpart' => 2,
'username' => strtolower($_POST['username']),
'_password' => strtolower($_POST['password'])
) );
error_log("[new_customer] received response from freeside: $response");
$error = $response['error'];
if ( ! $error ) {
// sucessful signup
$custnum = $response['custnum'];
error_log("[new_customer] signup up with custnum $custnum");
} else {
// unsucessful signup
error_log("[new_customer] signup error:: $error");
// display error message to user
}
?>
Index: process_login.php
===================================================================
RCS file: /home/cvs/cvsroot/freeside/fs_selfservice/php/process_login.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- process_login.php 23 Jan 2009 01:23:41 -0000 1.1
+++ process_login.php 14 Sep 2011 16:09:21 -0000 1.2
@@ -6,7 +6,7 @@
$response = $freeside->login( array(
'username' => strtolower($_POST['username']),
'domain' => strtolower($_POST['domain']),
- 'password' => strtolower($_POST['password']),
+ 'password' => $_POST['password'],
) );
#error_log("[login] received response from freeside: $response");
--- NEW FILE: freeside_login_example.php ---
<?
require('freeside.class.php');
$freeside = new FreesideSelfService();
$domain = 'example.com';
$response = $freeside->login( array(
'username' => strtolower($_POST['username']),
'domain' => $domain,
'password' => strtolower($_POST['password']),
) );
error_log("[login] received response from freeside: $response");
$error = $response['error'];
if ( ! $error ) {
// sucessful login
$session_id = $response['session_id'];
error_log("[login] logged into freeside with session_id=$session_id");
// store session id in your session store, to be used for other calls
} else {
// unsucessful login
error_log("[login] error logging into freeside: $error");
// display error message to user
}
?>
--- NEW FILE: freeside_agent_signup_example.php ---
<?
require('freeside.class.php');
$freeside = new FreesideSelfService();
$response = $freeside->new_agent( array(
'agent' => $_POST['agent'], #agent name
'username' => strtolower($_POST['username']),
'_password' => strtolower($_POST['password'])
) );
error_log("[new_agent] received response from freeside: $response");
$error = $response['error'];
if ( ! $error ) {
// sucessful signup
$session_id = $response['session_id'];
error_log("[new_agent] signup up agent");
} else {
// unsucessful signup
error_log("[new_agent] signup error: $error");
// display error message to user
}
?>
--- freeside.login_example.php DELETED ---
--- NEW FILE: freeside_agent_login_example.php ---
<?
require('freeside.class.php');
$freeside = new FreesideSelfService();
$response = $freeside->agent_login( array(
'username' => strtolower($_POST['username']),
'password' => strtolower($_POST['password']),
) );
error_log("[login] received response from freeside: $response");
$error = $response['error'];
if ( ! $error ) {
// sucessful login
$session_id = $response['session_id'];
error_log("[login] agent logged into freeside with session_id=$session_id");
// store session id in your session store, to be used for other calls
} else {
// unsucessful login
error_log("[login] error logging agent into freeside: $error");
// display error message to user
}
?>
More information about the freeside-commits
mailing list