gunnar: server/kolab-freebusy/freebusy generatefb.php,1.1,1.2

cvs at kolab.org cvs at kolab.org
Wed Feb 6 09:00:29 CET 2008


Author: gunnar

Update of /kolabrepository/server/kolab-freebusy/freebusy
In directory doto:/tmp/cvs-serv20882/kolab-freebusy/freebusy

Modified Files:
	generatefb.php 
Log Message:
Second draft version of the generatefb script (issue  kolab/issue1693). Should be split into a bash script and web callable script now.

Index: generatefb.php
===================================================================
RCS file: /kolabrepository/server/kolab-freebusy/freebusy/generatefb.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- generatefb.php	5 Feb 2008 17:00:52 -0000	1.1
+++ generatefb.php	6 Feb 2008 08:00:27 -0000	1.2
@@ -1,4 +1,3 @@
-#!/kolabrelease/bin/php -c /kolabrelease/etc/apache/php.ini
 <?php
 /*
  *  COPYRIGHT
@@ -36,55 +35,14 @@
 error_reporting(E_ALL);
 ini_set('memory_limit', -1); /* requires safe_mode to be turned off */
 
+/* Load the configuration */ 
+require_once 'config.php';
+
 /* Load the required free/busy libraries - this also loads Horde:: and
  Util:: as well as the PEAR constants*/ 
 require_once 'Kolab/Freebusy/Page.php';
 
-/* Load the configuration */ 
-require_once '../../kolab/www/freebusy/config.php';
-
-require_once('Console/Getopt.php');
-
-$imaphost = $conf['kolab']['imap']['server'];
-$imapport = $conf['kolab']['imap']['port'];
-$imapoptions = '/notls';
-$imapuser = 'manager';
-$imappw = false;
-
-/* Print out usage info */
-function usage()
-{
-    global $imaphost,$imapport,$imapuser,$imappw;
-    echo "Script for updating freebusy information on a kolab server.\n";
-    echo "Normal usage is:\n";
-    echo "\tsudo -u kolab-n ./generatefb.php [--help] [--imaphost=<imap hostname>] [--imapport=<imap port>] [--user=<manager user>] --password=<manager password>\n";
-    echo "Defaults:\n";
-    echo "\t--imaphost:\t$imaphost\n";
-    echo "\t--imapport:\t$imapport\n";
-    echo "\t--user:\t$imapuser\n";
-    echo "\t--password:\t<no default>\n";
-    exit(-1);
-}
-
-/* Parse command line options */
-list($options,$args) = Console_Getopt::getopt(Console_Getopt::readPHPArgv(),'h',array('help','imaphost=','imapport=','user=','password='));
-foreach( $options as $o ) {
-    $a = $o[1];
-    $o = $o[0];
-    switch($o) {
-	case 'h':
-	case '--help':       usage(); break;
-	case '--imaphost': $imaphost = $a; break;
-	case '--imapport': $imapport = $a; break;
-	case '--user':       $imapuser = $a; break;
-	case '--password': $imappw   = $a; break;
-    }
-}
-
-/* Password must be supplied */
-if(!$imappw) usage();
-
-$access = &new FolderAccess($imapuser, $imappw);
+$access = &new FolderAccess();
 $result = $access->authenticate();
 if (is_a($result, 'PEAR_Error')) {
     echo "Failed to authenticate!\n";





More information about the commits mailing list