aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-09-24 18:43:02 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-09-24 18:43:02 +0200
commit793e29e1245d079f89505294bef47f01c9111e8b (patch)
tree70c66381ebb5221547e881c99dc2b435e26e97e4 /apps
parentf65d0e4f80eba0d24ee48f16a22d290fb1f334b3 (diff)
parent842ce24d2b17685c27eabdd2d0bb01899efdbc6f (diff)
downloadnextcloud-server-793e29e1245d079f89505294bef47f01c9111e8b.tar.gz
nextcloud-server-793e29e1245d079f89505294bef47f01c9111e8b.zip
Merge branch 'working'
Diffstat (limited to 'apps')
-rw-r--r--apps/bookmarks/ajax/updateList.php3
-rw-r--r--apps/bookmarks/bookmarksHelper.php7
-rw-r--r--apps/calendar/ajax/deleteevent.php30
-rw-r--r--apps/calendar/js/calendar.js13
-rw-r--r--apps/calendar/lib/object.php9
-rw-r--r--apps/calendar/templates/part.editevent.php1
-rw-r--r--apps/calendar/templates/part.eventform.php14
-rw-r--r--apps/contacts/templates/part.addpropertyform.php14
-rw-r--r--apps/contacts/templates/part.details.php9
-rw-r--r--apps/files_publiclink/lib_public.php2
-rw-r--r--apps/files_sharing/get.php2
-rw-r--r--apps/media/ajax/autoupdate.php4
-rw-r--r--apps/media/getID3/getid3/getid3.lib.php4
-rw-r--r--apps/media/lib_ampache.php2
-rw-r--r--apps/media/lib_media.php2
-rw-r--r--apps/media/lib_scanner.php8
-rw-r--r--apps/media/server/xml.server.php2
-rw-r--r--apps/unhosted/lib_unhosted.php8
-rw-r--r--apps/user_openid/appinfo/app.php14
-rw-r--r--apps/user_openid/phpmyid.php20
-rw-r--r--apps/user_openid/user.php2
21 files changed, 119 insertions, 51 deletions
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php
index 67acb2190ca..e9051a8dbfa 100644
--- a/apps/bookmarks/ajax/updateList.php
+++ b/apps/bookmarks/ajax/updateList.php
@@ -70,7 +70,8 @@ $query = OC_DB::prepare('
ELSE \' \'
END
AS tags
- FROM *PREFIX*bookmarks, *PREFIX*bookmarks_tags
+ FROM *PREFIX*bookmarks
+ LEFT JOIN *PREFIX*bookmarks_tags ON 1=1
WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
OR *PREFIX*bookmarks.id NOT IN (
SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index aee941a27b9..d674e595a80 100644
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -9,7 +9,12 @@ function getURLMetadata($url) {
}
$metadata['url'] = $url;
- $page = file_get_contents($url);
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ $page = curl_exec($ch);
+ curl_close($ch);
+
@preg_match( "/<title>(.*)<\/title>/si", $page, $match );
$metadata['title'] = htmlspecialchars_decode(@$match[1]);
diff --git a/apps/calendar/ajax/deleteevent.php b/apps/calendar/ajax/deleteevent.php
new file mode 100644
index 00000000000..08a0e1a1e26
--- /dev/null
+++ b/apps/calendar/ajax/deleteevent.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+require_once('../../../lib/base.php');
+
+$l10n = new OC_L10N('calendar');
+
+if(!OC_USER::isLoggedIn()) {
+ die('<script type="text/javascript">document.location = oc_webroot;</script>');
+}
+
+$id = $_POST['id'];
+$data = OC_Calendar_Object::find($id);
+if (!$data)
+{
+ echo json_encode(array('status'=>'error'));
+ exit;
+}
+$calendar = OC_Calendar_Calendar::findCalendar($data['calendarid']);
+if($calendar['userid'] != OC_User::getUser()){
+ echo json_encode(array('status'=>'error'));
+ exit;
+}
+$result = OC_Calendar_Object::delete($id);
+echo json_encode(array('status' => 'success'));
+?>
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 1a8bc499574..61a1945c343 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -300,6 +300,19 @@ Calendar={
$('#dialog_holder').load(oc_webroot + '/apps/calendar/ajax/editeventform.php?id=' + id, Calendar.UI.startEventDialog);
}
},
+ submitDeleteEventForm:function(url){
+ var post = $( "#event_form" ).serialize();
+ $("#errorbox").html("");
+ $.post(url, post, function(data){
+ if(data.status == 'success'){
+ $('#event').dialog('destroy').remove();
+ Calendar.UI.loadEvents();
+ } else {
+ $("#errorbox").html("Deletion failed");
+ }
+
+ }, "json");
+ },
validateEventForm:function(url){
var post = $( "#event_form" ).serialize();
$("#errorbox").html("");
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index c4878dac651..0c7649776d5 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -115,7 +115,7 @@ class OC_Calendar_Object{
$stmt = OC_DB::prepare( 'UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?' );
$result = $stmt->execute(array($type,$startdate,$enddate,$repeating,$summary,$data,time(),$id));
- OC_Calendar_Calendar::touchCalendar($id);
+ OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
return true;
}
@@ -147,8 +147,10 @@ class OC_Calendar_Object{
* @return boolean
*/
public static function delete($id){
+ $oldobject = self::find($id);
$stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE id = ?' );
$stmt->execute(array($id));
+ OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']);
return true;
}
@@ -424,7 +426,7 @@ class OC_Calendar_Object{
{
$title = $request["title"];
$location = $request["location"];
- $categories = $request["categories"];
+ $categories = isset($request["categories"]) ? $request["categories"] : null;
$allday = isset($request["allday"]);
$from = $request["from"];
$fromtime = $request["fromtime"];
@@ -488,8 +490,7 @@ class OC_Calendar_Object{
}
if($description != ""){
- $des = str_replace("\n","\\n", $description);
- $vevent->DESCRIPTION = $des;
+ $vevent->DESCRIPTION = $description;
}else{
unset($vevent->DESCRIPTION);
}
diff --git a/apps/calendar/templates/part.editevent.php b/apps/calendar/templates/part.editevent.php
index 859828216b8..be637aeae55 100644
--- a/apps/calendar/templates/part.editevent.php
+++ b/apps/calendar/templates/part.editevent.php
@@ -5,6 +5,7 @@
<div style="width: 100%;text-align: center;color: #FF1D1D;" id="errorbox"></div>
<span id="actions">
<input type="button" class="submit" style="float: left;" value="<?php echo $l->t("Submit");?>" onclick="Calendar.UI.validateEventForm('ajax/editevent.php');">
+ <input type="button" class="submit" style="float: left;" name="delete" value="<?php echo $l->t("Delete");?>" onclick="Calendar.UI.submitDeleteEventForm('ajax/deleteevent.php');">
</span>
</form>
</div>
diff --git a/apps/calendar/templates/part.eventform.php b/apps/calendar/templates/part.eventform.php
index 5b12407330a..5bb072cc23b 100644
--- a/apps/calendar/templates/part.eventform.php
+++ b/apps/calendar/templates/part.eventform.php
@@ -2,13 +2,13 @@
<tr>
<th width="75px"><?php echo $l->t("Title");?>:</th>
<td>
- <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo $_['title'] ?>" maxlength="100" name="title"/>
+ <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Title of the Event");?>" value="<?php echo isset($_['title']) ? $_['title'] : '' ?>" maxlength="100" name="title"/>
</td>
</tr>
<tr>
<th width="75px"><?php echo $l->t("Location");?>:</th>
<td>
- <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo $_['location'] ?>" maxlength="100" name="location" />
+ <input type="text" style="width:350px;" size="100" placeholder="<?php echo $l->t("Location of the Event");?>" value="<?php echo isset($_['location']) ? $_['location'] : '' ?>" maxlength="100" name="location" />
</td>
</tr>
</table>
@@ -19,6 +19,7 @@
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
<?php
foreach($_['category_options'] as $category){
+ if (!isset($_['categories'])) {$_['categories'] = array();}
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
}
?>
@@ -28,6 +29,7 @@
<select style="width:140px;" name="calendar">
<?php
foreach($_['calendar_options'] as $calendar){
+ if (!isset($_['calendar'])) {$_['calendar'] = false;}
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
}
?>
@@ -64,8 +66,10 @@
<td>
<select name="repeat" style="width:350px;">
<?php
- foreach($_['repeat_options'] as $id => $label){
- echo '<option value="' . $id . '"' . ($_['repeat'] == $id ? ' selected="selected"' : '') . '>' . $label . '</option>';
+ if (isset($_['repeat_options'])) {
+ foreach($_['repeat_options'] as $id => $label){
+ echo '<option value="' . $id . '"' . ($_['repeat'] == $id ? ' selected="selected"' : '') . '>' . $label . '</option>';
+ }
}
?>
</select></td>
@@ -82,6 +86,6 @@
<table>
<tr>
<th width="75px" style="vertical-align: top;"><?php echo $l->t("Description");?>:</th>
- <td><textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo $_['description'] ?></textarea></td>
+ <td><textarea style="width:350px;height: 150px;" placeholder="<?php echo $l->t("Description of the Event");?>" name="description"><?php echo isset($_['description']) ? $_['description'] : '' ?></textarea></td>
</tr>
</table>
diff --git a/apps/contacts/templates/part.addpropertyform.php b/apps/contacts/templates/part.addpropertyform.php
index ad623b0dd62..885330e5778 100644
--- a/apps/contacts/templates/part.addpropertyform.php
+++ b/apps/contacts/templates/part.addpropertyform.php
@@ -17,13 +17,13 @@
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
- <?php echo $l->t('PO Box'); ?> <input type="text" name="value[0]" value="">
- <?php echo $l->t('Extended'); ?> <input type="text" name="value[1]" value="">
- <?php echo $l->t('Street'); ?> <input type="text" name="value[2]" value="">
- <?php echo $l->t('City'); ?> <input type="text" name="value[3]" value="">
- <?php echo $l->t('Region'); ?> <input type="text" name="value[4]" value="">
- <?php echo $l->t('Zipcode'); ?> <input type="text" name="value[5]" value="">
- <?php echo $l->t('Country'); ?> <input type="text" name="value[6]" value="">
+ <p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[0]" value=""></p>
+ <p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[1]" value=""></p>
+ <p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[2]" value=""></p>
+ <p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[3]" value=""></p>
+ <p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[4]" value=""></p>
+ <p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[5]" value=""></p>
+ <p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[6]" value=""></p>
</div>
<div id="contacts_phonepart">
<select name="parameters[TYPE]" size="1">
diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php
index c6bedcdd913..254d54a4e8e 100644
--- a/apps/contacts/templates/part.details.php
+++ b/apps/contacts/templates/part.details.php
@@ -27,9 +27,8 @@
<?php endif; ?>
<?php endforeach; ?>
</table>
+ <form>
+ <input type="button" id="contacts_deletecard" value="<?php echo $l->t('Delete');?>">
+ <input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>">
+ </form>
<?php endif; ?>
-
-<form>
- <input type="button" id="contacts_deletecard" value="<?php echo $l->t('Delete');?>">
- <input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>">
-</form>
diff --git a/apps/files_publiclink/lib_public.php b/apps/files_publiclink/lib_public.php
index ece0a540d39..f895615380d 100644
--- a/apps/files_publiclink/lib_public.php
+++ b/apps/files_publiclink/lib_public.php
@@ -14,7 +14,7 @@ class OC_PublicLink{
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- error_log( $entry );
+ if(defined("DEBUG") && DEBUG) {error_log( $entry );}
die( $entry );
}
$this->token=$token;
diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php
index a1b6c316cd5..33918bf9e7d 100644
--- a/apps/files_sharing/get.php
+++ b/apps/files_sharing/get.php
@@ -56,9 +56,11 @@ if ($source !== false) {
$list->assign("files", $files);
$list->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
$list->assign("downloadURL", OC_Helper::linkTo("files_sharing", "get.php")."?token=".$token."&path=");
+ $list->assign("readonly", true);
$tmpl = new OC_Template("files", "index", "user");
$tmpl->assign("fileList", $list->fetchPage());
$tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
+ $tmpl->assign("readonly", true);
$tmpl->printPage();
} else {
//get time mimetype and set the headers
diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php
index ded1fd02bc3..ac3d0650b4b 100644
--- a/apps/media/ajax/autoupdate.php
+++ b/apps/media/ajax/autoupdate.php
@@ -29,9 +29,9 @@ $RUNTIME_NOSETUPFS=true;
require_once('../../../lib/base.php');
-error_log($_GET['autoupdate']);
+if(defined("DEBUG") && DEBUG) {error_log($_GET['autoupdate']);}
$autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true');
-error_log((integer)$autoUpdate);
+if(defined("DEBUG") && DEBUG) {error_log((integer)$autoUpdate);}
OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate);
diff --git a/apps/media/getID3/getid3/getid3.lib.php b/apps/media/getID3/getid3/getid3.lib.php
index 4ed5e361f50..9322cae4dd8 100644
--- a/apps/media/getID3/getid3/getid3.lib.php
+++ b/apps/media/getID3/getid3/getid3.lib.php
@@ -1006,7 +1006,7 @@ class getid3_lib
}
- function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
+ static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
$HTMLstring = '';
switch ($charset) {
@@ -1187,7 +1187,7 @@ class getid3_lib
return (isset($ImageTypesLookup[$imagetypeid]) ? $ImageTypesLookup[$imagetypeid] : '');
}
- function CopyTagsToComments(&$ThisFileInfo) {
+ static function CopyTagsToComments(&$ThisFileInfo) {
// Copy all entries from ['tags'] into common ['comments']
if (!empty($ThisFileInfo['tags'])) {
diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php
index dc88e35a697..87291958af3 100644
--- a/apps/media/lib_ampache.php
+++ b/apps/media/lib_ampache.php
@@ -195,7 +195,7 @@ class OC_MEDIA_AMPACHE{
$filter=isset($params['filter'])?$params['filter']:'';
$exact=isset($params['exact'])?($params['exact']=='true'):false;
$artists=OC_MEDIA_COLLECTION::getArtists($filter,$exact);
- error_log('artists found: '.print_r($artists,true));
+ if(defined("DEBUG") && DEBUG) {error_log('artists found: '.print_r($artists,true));}
echo('<root>');
foreach($artists as $artist){
self::printArtist($artist);
diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php
index 3086f84a93a..1d8321a774c 100644
--- a/apps/media/lib_media.php
+++ b/apps/media/lib_media.php
@@ -37,7 +37,7 @@ class OC_MEDIA{
*/
public static function loginListener($params){
if(isset($_POST['user']) and $_POST['password']){
- error_log('postlogin');
+ if(defined("DEBUG") && DEBUG) {error_log('postlogin');}
$name=$_POST['user'];
$query=OC_DB::prepare("SELECT user_id from *PREFIX*media_users WHERE user_id LIKE ?");
$uid=$query->execute(array($name))->fetchAll();
diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php
index c774c3c9fdb..9bf9397b19a 100644
--- a/apps/media/lib_scanner.php
+++ b/apps/media/lib_scanner.php
@@ -97,25 +97,25 @@ class OC_MEDIA_SCANNER{
$data=@self::$getID3->analyze($file);
getid3_lib::CopyTagsToComments($data);
if(!isset($data['comments'])){
- error_log("error reading id3 tags in '$file'");
+ if(defined("DEBUG") && DEBUG) {error_log("error reading id3 tags in '$file'");}
return;
}
if(!isset($data['comments']['artist'])){
- error_log("error reading artist tag in '$file'");
+ if(defined("DEBUG") && DEBUG) {error_log("error reading artist tag in '$file'");}
$artist='unknown';
}else{
$artist=stripslashes($data['comments']['artist'][0]);
$artist=utf8_encode($artist);
}
if(!isset($data['comments']['album'])){
- error_log("error reading album tag in '$file'");
+ if(defined("DEBUG") && DEBUG) {error_log("error reading album tag in '$file'");}
$album='unknown';
}else{
$album=stripslashes($data['comments']['album'][0]);
$album=utf8_encode($album);
}
if(!isset($data['comments']['title'])){
- error_log("error reading title tag in '$file'");
+ if(defined("DEBUG") && DEBUG) {error_log("error reading title tag in '$file'");}
$title='unknown';
}else{
$title=stripslashes($data['comments']['title'][0]);
diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php
index e61fadf234c..387c3480047 100644
--- a/apps/media/server/xml.server.php
+++ b/apps/media/server/xml.server.php
@@ -36,7 +36,7 @@ foreach($arguments as &$argument){
}
ob_clean();
if(isset($arguments['action'])){
- error_log($arguments['action']);
+ if(defined("DEBUG") && DEBUG) {error_log($arguments['action']);}
switch($arguments['action']){
case 'url_to_song':
OC_MEDIA_AMPACHE::url_to_song($arguments);
diff --git a/apps/unhosted/lib_unhosted.php b/apps/unhosted/lib_unhosted.php
index 59dc380c45c..484f469f0ed 100644
--- a/apps/unhosted/lib_unhosted.php
+++ b/apps/unhosted/lib_unhosted.php
@@ -7,7 +7,7 @@ class OC_UnhostedWeb {
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- error_log( $entry );
+ if(defined("DEBUG") && DEBUG) {error_log( $entry );}
die( $entry );
}
$ret = array();
@@ -24,7 +24,7 @@ class OC_UnhostedWeb {
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- error_log( $entry );
+ if(defined("DEBUG") && DEBUG) {error_log( $entry );}
die( $entry );
}
$ret = array();
@@ -45,7 +45,7 @@ class OC_UnhostedWeb {
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- error_log( $entry );
+ if(defined("DEBUG") && DEBUG) {error_log( $entry );}
die( $entry );
}
}
@@ -56,7 +56,7 @@ class OC_UnhostedWeb {
if( PEAR::isError($result)) {
$entry = 'DB Error: "'.$result->getMessage().'"<br />';
$entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- error_log( $entry );
+ if(defined("DEBUG") && DEBUG) {error_log( $entry );}
die( $entry );
}
}
diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php
index 578f8f4dade..546f9f4565a 100644
--- a/apps/user_openid/appinfo/app.php
+++ b/apps/user_openid/appinfo/app.php
@@ -26,14 +26,14 @@ OC_User::useBackend('openid');
//check for results from openid requests
if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){
- error_log('openid retured');
+ if(defined("DEBUG") && DEBUG) {error_log('openid retured');}
$openid = new SimpleOpenID;
$openid->SetIdentity($_GET['openid_identity']);
$openid_validation_result = $openid->ValidateWithServer();
if ($openid_validation_result == true){ // OK HERE KEY IS VALID
- error_log('auth sucessfull');
+ if(defined("DEBUG") && DEBUG) {error_log('auth sucessfull');}
$identity=$openid->GetIdentity();
- error_log("auth as $identity");
+ if(defined("DEBUG") && DEBUG) {error_log("auth as $identity");}
$user=OC_USER_OPENID::findUserForIdentity($identity);
if($user){
$_SESSION['user_id']=$user;
@@ -41,13 +41,13 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){
}
}else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR
$error = $openid->GetError();
- error_log("ERROR CODE: " . $error['code']);
- error_log("ERROR DESCRIPTION: " . $error['description']);
+ if(defined("DEBUG") && DEBUG) {error_log("ERROR CODE: " . $error['code']);}
+ if(defined("DEBUG") && DEBUG) {error_log("ERROR DESCRIPTION: " . $error['description']);}
}else{ // Signature Verification Failed
- error_log("INVALID AUTHORIZATION");
+ if(defined("DEBUG") && DEBUG) {error_log("INVALID AUTHORIZATION");}
}
}else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request
- error_log("USER CANCELED REQUEST");
+ if(defined("DEBUG") && DEBUG) {error_log("USER CANCELED REQUEST");}
return false;
}
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index 24fab44ca7a..5009fa410aa 100644
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -1054,7 +1054,7 @@ function debug ($x, $m = null) {
$x .= "\n";
}
- error_log($x . "\n", 3, $profile['logfile']);
+ if(defined("DEBUG") && DEBUG) {error_log($x . "\n", 3, $profile['logfile']);}
}
@@ -1069,6 +1069,9 @@ function destroy_assoc_handle ( $id ) {
session_write_close();
session_id($id);
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
session_destroy();
@@ -1194,6 +1197,9 @@ function new_assoc ( $expiration ) {
session_write_close();
}
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
session_regenerate_id('false');
@@ -1265,6 +1271,9 @@ function secret ( $handle ) {
}
session_id($handle);
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
session_start();
debug('Started session to acquire key: ' . session_id());
@@ -1467,6 +1476,9 @@ function user_session () {
global $proto, $profile;
session_name('phpMyID_Server');
+ if (OC_Config::getValue( "forcessl", false )) {
+ ini_set("session.cookie_secure", "on");
+ }
@session_start();
$profile['authorized'] = (isset($_SESSION['auth_username'])
@@ -1501,7 +1513,7 @@ function wrap_html ( $message ) {
</body>
</html>
';
- error_log($html);
+ if(defined("DEBUG") && DEBUG) {error_log($html);}
echo $html;
exit(0);
}
@@ -1653,8 +1665,8 @@ $profile['req_url'] = sprintf("%s://%s%s",
// $profile['req_url']=str_replace($incompleteId,$fullId,$profile['req_url']);
// }
-// error_log('inc id: '.$fullId);
-// error_log('req url: '.$profile['req_url']);
+// if(defined("DEBUG") && DEBUG) {error_log('inc id: '.$fullId);}
+// if(defined("DEBUG") && DEBUG) {error_log('req url: '.$profile['req_url']);}
// Set the default allowance for testing
if (! array_key_exists('allow_test', $profile))
diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php
index 60e12ed88e0..d90e0b71900 100644
--- a/apps/user_openid/user.php
+++ b/apps/user_openid/user.php
@@ -39,7 +39,7 @@ $RUNTIME_NOAPPS=false;
require_once '../../lib/base.php';
if(!OC_User::userExists($USERNAME)){
- error_log($USERNAME.' doesn\'t exist');
+ if(defined("DEBUG") && DEBUG) {error_log($USERNAME.' doesn\'t exist');}
$USERNAME='';
}
$IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME;