[Hw4mdl-svn] SF.net SVN: hw4mdl: [128] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-12-27 10:32:24
|
Revision: 128
http://svn.sourceforge.net/hw4mdl/?rev=128&view=rev
Author: shazan
Date: 2006-12-27 02:32:22 -0800 (Wed, 27 Dec 2006)
Log Message:
-----------
fix bug 10515 : an error message is display if the user name or password is incorrect
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/config.html
trunk/moodle/mod/liveclassroom/lib.php
trunk/moodle/mod/liveclassroom/logs.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-12-27 09:39:30 UTC (rev 127)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-12-27 10:32:22 UTC (rev 128)
@@ -143,11 +143,18 @@
preg_match("(\d*)", $data, $matches);
$resp_code = $matches[0];
- if ( $resp_code != 100 && $resp_code != 301) {
+ if ( $resp_code == 204 ) {
+ add_to_log($COURSE->id, "liveclassroom", "Authentication", liveclassroom_send_logs("errorAuthentication2","respcode=$resp_code&courseId=".$COURSE->id), "Authentication Failed");
+ error(get_string('wrongadminpass', 'liveclassroom'));
+ return false;
+ }
+ else if ( $resp_code != 100 && $resp_code != 301) {
//error( "Response: Authentication Failed: $resp_code");
add_to_log($COURSE->id, "liveclassroom", "Authentication", liveclassroom_send_logs("errorAuthentication","respcode=$resp_code&courseId=".$COURSE->id), "Authentication Failed");
return false;
}
+
+
curl_close($ch);
//fclose($cook);
add_to_log($COURSE->id, "liveclassroom", "Authentication", liveclassroom_send_logs("authentication","courseId=".$COURSE->id), "Authentication succeeded");
Modified: trunk/moodle/mod/liveclassroom/config.html
===================================================================
--- trunk/moodle/mod/liveclassroom/config.html 2006-12-27 09:39:30 UTC (rev 127)
+++ trunk/moodle/mod/liveclassroom/config.html 2006-12-27 10:32:22 UTC (rev 128)
@@ -32,7 +32,7 @@
<tr valign="top">
<td align="right"><?php print_string('adminpassword', 'liveclassroom')?> :</td>
<td>
- <input name="adminpassword" type="text" size="30" value="<?php p($CFG->liveclassroom_adminpassword) ?>" />
+ <input name="adminpassword" type="password" size="30" value="<?php p($CFG->liveclassroom_adminpassword) ?>" />
</td>
<td>
<?php print_string("configadminpassword", "liveclassroom") ?>
Modified: trunk/moodle/mod/liveclassroom/lib.php
===================================================================
--- trunk/moodle/mod/liveclassroom/lib.php 2006-12-27 09:39:30 UTC (rev 127)
+++ trunk/moodle/mod/liveclassroom/lib.php 2006-12-27 10:32:22 UTC (rev 128)
@@ -49,13 +49,17 @@
if(empty($config->servername)){
add_to_log("", "liveclassroom", "URL", liveclassroom_send_logs("errorUrlUnavailable",""), "URL unavailable");
error(get_string('wrongconfigurationURLunavailable', 'liveclassroom'));
+ }
+ else if(empty($config->adminusername)){
+ error(get_string('emptyAdminUsername', 'liveclassroom'));
+ }
+ else if(empty($config->adminpassword)){
+ error(get_string('emptyAdminPassword', 'liveclassroom'));
}
- else if (!liveclassroom_api_authenticate($config->servername,
- $config->adminusername,
- $config->adminpassword))
- {
- error(get_string('wrongconfigurationURLincorrect', 'liveclassroom'));
-}
+ liveclassroom_api_authenticate($config->servername,$config->adminusername,$config->adminpassword);
+
+// error(get_string('wrongconfigurationURLincorrect', 'liveclassroom'));
+
//TODO: check the user is really an admin
return;
Modified: trunk/moodle/mod/liveclassroom/logs.php
===================================================================
--- trunk/moodle/mod/liveclassroom/logs.php 2006-12-27 09:39:30 UTC (rev 127)
+++ trunk/moodle/mod/liveclassroom/logs.php 2006-12-27 10:32:22 UTC (rev 128)
@@ -97,9 +97,16 @@
$information = "Authentication Failed.";
if(isset($_GET['respcode'])){
$message = "Error : Authentication Failed.";
- $tip = "The response code is : ".$_GET['respcode']."Please contact your administrator.";
+ $tip = "The response code is : ".$_GET['respcode']." Please contact your administrator.";
}
break;
+ case "errorAuthentication2":
+ $information = "Authentication Failed.";
+ if(isset($_GET['respcode'])){
+ $message = "Error : Authentication Failed. Bad username or password";
+ $tip = "The response code is : ".$_GET['respcode']." Please contact your administrator.";
+ }
+ break;
case "authentication":
$information = "Authentication succeeded.";
$message = "The authentication to the Live Classroom server is succeeded.";
@@ -114,7 +121,7 @@
$information = "User creation";
if(isset($_GET['userId'])){
$message = "Error : ".$_GET['userId']." Creation Failed.";
- $tip = "The response code is : ".$_GET['respcode']."Please contact your administrator.";
+ $tip = "The response code is : ".$_GET['respcode']." Please contact your administrator.";
}
break;
case "createSession":
@@ -127,7 +134,7 @@
$information = "Session creation";
if( (isset($_GET['respcode'])) && (isset($_GET['nickname'])) ){
$message = "Error : Cannot create a session for ".$_GET['nickname'];
- $tip = "The response code is : ".$_GET['respcode']."Please contact your administrator.";
+ $tip = "The response code is : ".$_GET['respcode']." Please contact your administrator.";
}
break;
case "createClass":
@@ -140,7 +147,7 @@
$information = "Room creation";
if( (isset($_GET['respcode'])) && (isset($_GET['roomname'])) ){
$message = "Error : Cannot Create Class with id : ".$_GET['roomId'].", and name : ".$_GET['roomname'];
- $tip = "The response code is : ".$_GET['respcode']."Please contact your administrator.";
+ $tip = "The response code is : ".$_GET['respcode']." Please contact your administrator.";
}
break;
case "deleteRoom":
@@ -380,7 +387,7 @@
</tr>
<tr bgcolor="yellow">
<td bgcolor="yellow" width="1"></td>
- <td bgcolor="#ffffd0"><font size="-1" face="Courier New,Courier,Monaco">tips
+ <td bgcolor="#ffffd0"><font size="-1" face="Courier New,Courier,Monaco"><?php echo $tip; ?>
</font>
<p></p>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|