[Hw4mdl-svn] SF.net SVN: hw4mdl: [95] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-10-27 15:32:22
|
Revision: 95
http://svn.sourceforge.net/hw4mdl/?rev=95&view=rev
Author: shazan
Date: 2006-10-27 08:32:12 -0700 (Fri, 27 Oct 2006)
Log Message:
-----------
remove group possibility
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/mod.html
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-10-20 14:21:24 UTC (rev 94)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-10-27 15:32:12 UTC (rev 95)
@@ -106,9 +106,10 @@
//add_to_log("", "liveclassroom", "", "liveclassroom_api_authenticate", "URL Sent: $url");
//add_to_log("", "liveclassroom", "", "", "Creating Auth Cookie in: ".dirname(__FILE__).'/cookie.txt');
- $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path
-
-
+ $cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path
+ $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date
+ fputs($cook,time()); // Add the current time into the file = last authenticate time
+
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
@@ -118,7 +119,7 @@
// curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
- $cook = fopen($CFG->dataroot.'/tmp.txt', "w+"); //temporary file to check the date
+
if (curl_errno($ch)) {
print curl_error($ch);
return false;
@@ -132,7 +133,7 @@
}
curl_close($ch);
- fclose($cook);
+ //fclose($cook);
return $ch;
}
@@ -149,20 +150,18 @@
global $CFG;
global $LIVECLASSROOM_API_ADMIN;
- $cook = fopen($CFG->dataroot.'/tmp.txt',"a+"); //Open the temp file to check the last modification date
+ $cook = $CFG->dataroot.'/tmp.txt'; //Open the temp file to check the last modification date
$cookie_file_path = $CFG->dataroot.'/cookie.txt'; // Cookie File path
if(file_exists($cook)) {
- $lastModifTime = filemtime($cook);
- add_to_log("", "liveclassroom", "", "", "last modif time ".$lastModifTime);
+ $fileContent = file_get_contents($cook);
}
else {
- $lastModifTime = time();
+ $lastModifTime = 0;
}
//1800 seconds = 30 minutes
- $modif = $lastModifTime+1800;
-
-
+ $modif = $fileContent+1800;
+
if( (!file_exists($cookie_file_path)) || ((file_exists($cook)) && (time()>$modif)) ){
if (!$ch = liveclassroom_api_authenticate()) {
return false;
@@ -191,7 +190,6 @@
return $data;
}
-
Modified: trunk/moodle/mod/liveclassroom/mod.html
===================================================================
--- trunk/moodle/mod/liveclassroom/mod.html 2006-10-20 14:21:24 UTC (rev 94)
+++ trunk/moodle/mod/liveclassroom/mod.html 2006-10-27 15:32:12 UTC (rev 95)
@@ -207,9 +207,9 @@
<!-- The following line for Moodle 1.5 prints the visibility setting form element -->
<?php print_visible_setting($form); ?>
-<!-- and if your module uses groups you would also have -->
-<?php print_groupmode_setting($form); ?>
+
+
<tr>
<td><br></td>
</tr>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|