summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorGeorg Ehrke <ownclouddev@georgswebsite.de>2011-11-12 15:09:37 +0100
committerGeorg Ehrke <ownclouddev@georgswebsite.de>2011-11-12 15:09:37 +0100
commite5a3ab8aad0b0deb312a97acb3fc808b497b0544 (patch)
tree5f7074a651b979cd0c9659de3f8d3fb6066fa37b /apps
parent03d9fab3c0cf3a3c50259d6a33439a998628b45c (diff)
parentef124c3e21ceae49f0f704589a833d1208d99c65 (diff)
downloadnextcloud-server-e5a3ab8aad0b0deb312a97acb3fc808b497b0544.tar.gz
nextcloud-server-e5a3ab8aad0b0deb312a97acb3fc808b497b0544.zip
Merge branch 'master' into fullcalendar
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_dependencies_chk/appinfo/app.php9
-rw-r--r--apps/admin_dependencies_chk/appinfo/info.xml11
-rw-r--r--apps/admin_dependencies_chk/css/style.css9
-rw-r--r--apps/admin_dependencies_chk/settings.php96
-rw-r--r--apps/admin_dependencies_chk/templates/settings.php16
-rw-r--r--apps/bookmarks/ajax/addBookmark.php8
-rw-r--r--apps/bookmarks/settings.php2
-rw-r--r--apps/calendar/lib/calendar.php4
-rw-r--r--apps/calendar/lib/object.php4
-rw-r--r--apps/calendar/templates/part.eventform.php12
-rw-r--r--apps/contacts/ajax/getdetails.php12
-rw-r--r--apps/contacts/ajax/showaddcard.php5
-rw-r--r--apps/contacts/ajax/showsetproperty.php2
-rw-r--r--apps/contacts/css/styles.css4
-rw-r--r--apps/contacts/js/interface.js6
-rw-r--r--apps/contacts/lib/addressbook.php4
-rw-r--r--apps/contacts/lib/vcard.php34
-rw-r--r--apps/contacts/templates/part.addcardform.php26
-rw-r--r--apps/contacts/templates/part.details.php20
-rw-r--r--apps/contacts/templates/part.setpropertyform.php24
-rw-r--r--apps/files_sharing/js/share.js7
-rw-r--r--apps/media/lib_collection.php2
-rw-r--r--apps/remoteStorage/lib_remoteStorage.php24
-rw-r--r--apps/user_webfinger/webfinger.php11
24 files changed, 250 insertions, 102 deletions
diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php
new file mode 100644
index 00000000000..e2169b5dd77
--- /dev/null
+++ b/apps/admin_dependencies_chk/appinfo/app.php
@@ -0,0 +1,9 @@
+<?php
+$l=new OC_L10N('admin_dependencies_chk');
+
+OC_App::register( array(
+ 'order' => 14,
+ 'id' => 'admin_dependencies_chk',
+ 'name' => 'Owncloud Install Info' ));
+
+OC_APP::registerAdmin('admin_dependencies_chk','settings');
diff --git a/apps/admin_dependencies_chk/appinfo/info.xml b/apps/admin_dependencies_chk/appinfo/info.xml
new file mode 100644
index 00000000000..10721ece15b
--- /dev/null
+++ b/apps/admin_dependencies_chk/appinfo/info.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<info>
+ <id>admin_dependencies_chk</id>
+ <name>Owncloud dependencies info</name>
+ <version>0.01</version>
+ <licence>AGPL</licence>
+ <author>Brice Maron (eMerzh)</author>
+ <require>2</require>
+ <description>Display OwnCloud's dependencies informations (missings modules, ...)</description>
+ <default_enable/>
+</info>
diff --git a/apps/admin_dependencies_chk/css/style.css b/apps/admin_dependencies_chk/css/style.css
new file mode 100644
index 00000000000..30f204be7bc
--- /dev/null
+++ b/apps/admin_dependencies_chk/css/style.css
@@ -0,0 +1,9 @@
+#status_list legend { font-weight: bold; color: #888888; }
+.state > li { margin-bottom: 3px; padding-left: 0.5em; list-style-type: circle; }
+.state .state_module { font-weight:bold; text-shadow: 0 1px 0 #DDD; cursor:help;}
+
+.state_used ul, .state_used li { display:inline; }
+
+.state_ok .state_module { color: #009700; }
+.state_warning .state_module { color: #FF9B29; }
+.state_error .state_module { color: #FF3B3B; }
diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php
new file mode 100644
index 00000000000..de2f97aa79d
--- /dev/null
+++ b/apps/admin_dependencies_chk/settings.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * ownCloud - user_ldap
+ *
+ * @author Brice Maron
+ * @copyright 2011 Brice Maron brice __from__ bmaron _DOT_ net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+$l=new OC_L10N('admin_dependencies_chk');
+$tmpl = new OC_Template( 'admin_dependencies_chk', 'settings');
+
+$modules = array();
+
+//Possible status are : ok, error, warning
+$modules[] =array(
+ 'status' => function_exists('json_encode') ? 'ok' : 'error',
+ 'part'=> 'php-json',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The php-json module is needed by the many applications for inter communications'));
+
+$modules[] =array(
+ 'status' => function_exists('curl_init') ? 'ok' : 'error',
+ 'part'=> 'php-curl',
+ 'modules'=> array('bookmarks'),
+ 'message'=> $l->t('The php-curl modude is needed to fetch the page title when adding a bookmarks'));
+
+$modules[] =array(
+ 'status' => function_exists('imagepng') ? 'ok' : 'error',
+ 'part'=> 'php-gd',
+ 'modules'=> array('gallery'),
+ 'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
+
+$modules[] =array(
+ 'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
+ 'part'=> 'mp3info',
+ 'modules'=> array('media'),
+ 'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
+
+$modules[] =array(
+ 'status' => OC_Helper::canExecute("ldap_bind") ? 'ok' : 'error',
+ 'part'=> 'php-ldap',
+ 'modules'=> array('user_ldap'),
+ 'message'=> $l->t('The php-ldap module is needed connect to your ldap server'));
+
+$modules[] =array(
+ 'status' => class_exists('ZipArchive') ? 'ok' : 'warning',
+ 'part'=> 'php-zip',
+ 'modules'=> array('admin_export','core'),
+ 'message'=> $l->t('The php-zip module is needed download multiple files at once'));
+
+$modules[] =array(
+ 'status' => function_exists('mb_detect_encoding') ? 'ok' : 'error',
+ 'part'=> 'php-mb_multibyte ',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The php-mb_multibyte module is needed to manage correctly the encoding.'));
+
+$modules[] =array(
+ 'status' => function_exists('ctype_digit') ? 'ok' : 'error',
+ 'part'=> 'php-ctype',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The php-ctype module is needed validate data.'));
+
+$modules[] =array(
+ 'status' => ini_get('allow_url_fopen') == '1' ? 'ok' : 'error',
+ 'part'=> 'allow_url_fopen',
+ 'modules'=> array('core'),
+ 'message'=> $l->t('The allow_url_fopen directive of your php.ini should be set to 1 to retrieve knowledge base from OCS servers'));
+
+foreach($modules as $key => $module) {
+ $enabled = false ;
+ foreach($module['modules'] as $app) {
+ if(OC_App::isEnabled($app) || $app=='core'){
+ $enabled = true;
+ }
+ }
+ if($enabled == false) unset($modules[$key]);
+}
+
+OC_UTIL::addStyle('admin_dependencies_chk', 'style');
+$tmpl->assign( 'items', $modules );
+
+return $tmpl->fetchPage();
diff --git a/apps/admin_dependencies_chk/templates/settings.php b/apps/admin_dependencies_chk/templates/settings.php
new file mode 100644
index 00000000000..8ff27ebb187
--- /dev/null
+++ b/apps/admin_dependencies_chk/templates/settings.php
@@ -0,0 +1,16 @@
+<fieldset id="status_list" class="personalblock">
+ <legend><?php echo $l->t('Dependencies status');?></legend>
+ <ul class="state">
+ <?php foreach($_['items'] as $item):?>
+ <li class="state_<?php echo $item['status'];?>">
+ <span class="state_module" title="<?php echo $item['message'];?>"><?php echo $item['part'];?></span>
+ <div class="state_used"><?php echo $l->t('Used by :');?>
+ <ul>
+ <?php foreach($item['modules'] as $module):?>
+ <li><?php echo $module;?></li>
+ <?php endforeach;?>
+ </ul>
+ </li>
+ <?php endforeach;?>
+ </ul>
+</fieldset> \ No newline at end of file
diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php
index 3975fd15f81..45b16ae5fa6 100644
--- a/apps/bookmarks/ajax/addBookmark.php
+++ b/apps/bookmarks/ajax/addBookmark.php
@@ -54,13 +54,7 @@ $params=array(
);
$query->execute($params);
-if($CONFIG_DBTYPE == 'pgsql')
-{
- $query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')");
- $b_id = $query->execute()->fetchOne();
-} else {
- $b_id = OC_DB::insertid();
-}
+$b_id = OC_DB::insertid('*PREFIX*bookmarks');
if($b_id !== false) {
diff --git a/apps/bookmarks/settings.php b/apps/bookmarks/settings.php
index 8186472dec9..0ace04fa2c8 100644
--- a/apps/bookmarks/settings.php
+++ b/apps/bookmarks/settings.php
@@ -8,6 +8,6 @@
$tmpl = new OC_Template( 'bookmarks', 'settings');
-OC_Util::addScript('bookmarks','settings');
+//OC_Util::addScript('bookmarks','settings');
return $tmpl->fetchPage();
diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php
index 252ea66555c..3db4398096e 100644
--- a/apps/calendar/lib/calendar.php
+++ b/apps/calendar/lib/calendar.php
@@ -111,7 +111,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_calendar');
}
/**
@@ -131,7 +131,7 @@ class OC_Calendar_Calendar{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_calendars');
}
/**
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index 221df2b3af0..ccc62d565e8 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -106,7 +106,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**
@@ -125,7 +125,7 @@ class OC_Calendar_Object{
OC_Calendar_Calendar::touchCalendar($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*calendar_objects');
}
/**
diff --git a/apps/calendar/templates/part.eventform.php b/apps/calendar/templates/part.eventform.php
index 8588b9168f7..dfa5fb8c78a 100644
--- a/apps/calendar/templates/part.eventform.php
+++ b/apps/calendar/templates/part.eventform.php
@@ -13,9 +13,7 @@
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
<?php
if (!isset($_['categories'])) {$_['categories'] = array();}
- foreach($_['category_options'] as $category){
- echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
- }
+ echo html_select_options($_['category_options'], $_['categories'], array('combine'=>true));
?>
</select></td>
<th width="75px">&nbsp;&nbsp;&nbsp;<?php echo $l->t("Calendar");?>:</th>
@@ -23,9 +21,7 @@
<select style="width:140px;" name="calendar">
<?php
if (!isset($_['calendar'])) {$_['calendar'] = false;}
- foreach($_['calendar_options'] as $calendar){
- echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
- }
+ echo html_select_options($_['calendar_options'], $_['calendar'], array('value'=>'id', 'label'=>'displayname'));
?>
</select></td>
</tr>
@@ -66,9 +62,7 @@
<select name="repeat" style="width:350px;">
<?php
if (isset($_['repeat_options'])) {
- foreach($_['repeat_options'] as $id => $label){
- echo '<option value="' . $id . '"' . ($_['repeat'] == $id ? ' selected="selected"' : '') . '>' . $label . '</option>';
- }
+ echo html_select_options($_['repeat_options'], $_['repeat']);
}
?>
</select></td>
diff --git a/apps/contacts/ajax/getdetails.php b/apps/contacts/ajax/getdetails.php
index 0e76de61afb..260fb53a686 100644
--- a/apps/contacts/ajax/getdetails.php
+++ b/apps/contacts/ajax/getdetails.php
@@ -51,10 +51,22 @@ if(is_null($vcard)){
exit();
}
+$property_types = array(
+ 'ADR' => $l10n->t('Address'),
+ 'TEL' => $l10n->t('Telephone'),
+ 'EMAIL' => $l10n->t('Email'),
+ 'ORG' => $l10n->t('Organization'),
+);
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
+
$details = OC_Contacts_VCard::structureContact($vcard);
$tmpl = new OC_Template('contacts','part.details');
$tmpl->assign('details',$details);
$tmpl->assign('id',$id);
+$tmpl->assign('property_types',$property_types);
+$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'id' => $id, 'page' => $page )));
diff --git a/apps/contacts/ajax/showaddcard.php b/apps/contacts/ajax/showaddcard.php
index 2f534f0fe2d..98367758fd4 100644
--- a/apps/contacts/ajax/showaddcard.php
+++ b/apps/contacts/ajax/showaddcard.php
@@ -29,9 +29,14 @@ $l10n = new OC_L10N('contacts');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('contacts');
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
+$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
+
$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
$tmpl = new OC_Template('contacts','part.addcardform');
$tmpl->assign('addressbooks',$addressbooks);
+$tmpl->assign('adr_types',$adr_types);
+$tmpl->assign('phone_types',$phone_types);
$page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'page' => $page )));
diff --git a/apps/contacts/ajax/showsetproperty.php b/apps/contacts/ajax/showsetproperty.php
index 6188f4773c3..4ec3dd7d8e1 100644
--- a/apps/contacts/ajax/showsetproperty.php
+++ b/apps/contacts/ajax/showsetproperty.php
@@ -61,11 +61,13 @@ if(is_null($line)){
exit();
}
+$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
$tmpl = new OC_Template('contacts','part.setpropertyform');
$tmpl->assign('id',$id);
$tmpl->assign('checksum',$checksum);
$tmpl->assign('property',OC_Contacts_VCard::structureProperty($vcard->children[$line]));
+$tmpl->assign('adr_types',$adr_types);
$page = $tmpl->fetchPage();
OC_JSON::success(array('data' => array( 'page' => $page )));
diff --git a/apps/contacts/css/styles.css b/apps/contacts/css/styles.css
index 68f843b7aaf..ad64c777ee7 100644
--- a/apps/contacts/css/styles.css
+++ b/apps/contacts/css/styles.css
@@ -4,9 +4,9 @@
#contacts_deletecard {position:absolute;top:15px;right:0;}
#contacts_details_list { list-style:none; }
#contacts_details_list li { overflow:hidden; }
-#contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em; }
+#contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em;color:#666; }
#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%; overflow:hidden; }
-#contacts_addproperty, #contacts_addproperty_button { margin-left:25%; }
+#contacts_addproperty_button, #contacts_setproperty_button { margin-left:25%; }
.contacts_property_data ul, .contacts_property_data ol { list-style:none; }
.contacts_property_data li { overflow: hidden; }
diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js
index 9270297f322..1cc3a5dfd63 100644
--- a/apps/contacts/js/interface.js
+++ b/apps/contacts/js/interface.js
@@ -56,13 +56,13 @@ $(document).ready(function(){
$('#contacts_addpropertyform #contacts_fieldpart').remove();
$('#contacts_addpropertyform #contacts_generic').remove();
if($(this).val() == 'ADR'){
- $('#contacts_addresspart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
+ $('#contacts_addresspart').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
}
else if($(this).val() == 'TEL'){
- $('#contacts_phonepart').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
+ $('#contacts_phonepart').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
}
else{
- $('#contacts_generic').clone().insertBefore($('#contacts_addpropertyform input[type="submit"]'));
+ $('#contacts_generic').clone().insertAfter($('#contacts_addpropertyform .contacts_property_name'));
}
});
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 2e869d7de3b..87477ed7ed4 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -96,7 +96,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**
@@ -113,7 +113,7 @@ class OC_Contacts_Addressbook{
$stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_addressbooks (userid,displayname,uri,description,ctag) VALUES(?,?,?,?,?)' );
$result = $stmt->execute(array($userid,$name,$uri,$description,1));
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_addressbooks');
}
/**
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php
index 74bc0f92f1b..56602f25c0a 100644
--- a/apps/contacts/lib/vcard.php
+++ b/apps/contacts/lib/vcard.php
@@ -95,10 +95,15 @@ class OC_Contacts_VCard{
$card = self::parse($data);
if(!is_null($card)){
+ // VCARD must have a version
+ $hasversion = false;
foreach($card->children as $property){
if($property->name == 'FN'){
$fn = $property->value;
}
+ elseif($property->name == 'VERSION'){
+ $hasversion = true;
+ }
elseif(is_null($uri) && $property->name == 'UID' ){
$uri = $property->value.'.vcf';
}
@@ -109,6 +114,11 @@ class OC_Contacts_VCard{
$card->add(new Sabre_VObject_Property('UID',$uid));
$data = $card->serialize();
};
+ // Add version if needed
+ if(!$hasversion){
+ $card->add(new Sabre_VObject_Property('VERSION','3.0'));
+ $data = $card->serialize();
+ }
}
else{
// that's hard. Creating a UID and not saving it
@@ -121,7 +131,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**
@@ -147,7 +157,7 @@ class OC_Contacts_VCard{
OC_Contacts_Addressbook::touch($id);
- return OC_DB::insertid();
+ return OC_DB::insertid('*PREFIX*contacts_cards');
}
/**
@@ -362,4 +372,24 @@ class OC_Contacts_VCard{
return null;
}
}
+ public static function getTypesOfProperty($l, $prop){
+ switch($prop){
+ case 'ADR':
+ return array(
+ 'WORK' => $l->t('Work'),
+ 'HOME' => $l->t('Home'),
+ );
+ case 'TEL':
+ return array(
+ 'HOME' => $l->t('Home'),
+ 'CELL' => $l->t('Mobile'),
+ 'WORK' => $l->t('Work'),
+ 'TEXT' => $l->t('Text'),
+ 'VOICE' => $l->t('Voice'),
+ 'FAX' => $l->t('Fax'),
+ 'VIDEO' => $l->t('Video'),
+ 'PAGER' => $l->t('Pager'),
+ );
+ }
+ }
}
diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php
index 8e482cc4eba..037e3629bb9 100644
--- a/apps/contacts/templates/part.addcardform.php
+++ b/apps/contacts/templates/part.addcardform.php
@@ -7,9 +7,7 @@
<li class="input stringish">
<label class="label" for="id"><?php echo $l->t('Group'); ?></label>
<select name="id" size="1">
- <?php foreach($_['addressbooks'] as $addressbook): ?>
- <option value="<?php echo $addressbook['id']; ?>"><?php echo $addressbook['displayname']; ?></option>
- <?php endforeach; ?>
+ <?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
</select>
</li>
</ol>
@@ -19,7 +17,7 @@
<ol>
<li class="input stringish">
<label class="label" for="fn"><?php echo $l->t('Name'); ?></label>
- <input type="text" name="fn" value=""><br>
+ <input id="fn" type="text" name="fn" value=""><br>
</li>
<li class="input stringish">
<label class="label" for="org"><?php echo $l->t('Organization'); ?></label>
@@ -46,14 +44,7 @@
<li class="fragment">
<label for="tel_type"><?php echo $l->t('Type'); ?></label>
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
- <option value="home"><?php echo $l->t('Home'); ?></option>
- <option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
- <option value="work"><?php echo $l->t('Work'); ?></option>
- <option value="text"><?php echo $l->t('Text'); ?></option>
- <option value="voice"><?php echo $l->t('Voice'); ?></option>
- <option value="fax"><?php echo $l->t('Fax'); ?></option>
- <option value="video"><?php echo $l->t('Video'); ?></option>
- <option value="pager"><?php echo $l->t('Pager'); ?></option>
+ <?php echo html_select_options($_['phone_types'], 'CELL') ?>
</select>
</li>
</ol>
@@ -67,8 +58,7 @@
<li class="input">
<label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
- <option value="work"><?php echo $l->t('Work'); ?></option>
- <option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
+ <?php echo html_select_options($_['adr_types'], 'HOME') ?>
</select>
</li>
<li class="input stringish">
@@ -81,19 +71,19 @@
</li>
<li class="input stringish">
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
- <input type="text" for="adr_street" name="value[ADR][2]" value="">
+ <input type="text" id="adr_street" name="value[ADR][2]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
- <input type="text" for="adr_city" name="value[ADR][3]" value="">
+ <input type="text" id="adr_city" name="value[ADR][3]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
- <input type="text" for="adr_region" name="value[ADR][4]" value="">
+ <input type="text" id="adr_region" name="value[ADR][4]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
- <input type="text" for="adr_zipcode" name="value[ADR][5]" value="">
+ <input type="text" id="adr_zipcode" name="value[ADR][5]" value="">
</li>
<li class="input stringish">
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php
index e9fa8356e8b..f5bd75809b1 100644
--- a/apps/contacts/templates/part.details.php
+++ b/apps/contacts/templates/part.details.php
@@ -27,15 +27,13 @@
<input type="hidden" name="id" value="<?php echo $_['id']; ?>">
<p class="contacts_property_name">
<select name="name" size="1">
- <option value="ADR"><?php echo $l->t('Address'); ?></option>
- <option value="TEL"><?php echo $l->t('Telephone'); ?></option>
- <option value="EMAIL" selected="selected"><?php echo $l->t('Email'); ?></option>
- <option value="ORG"><?php echo $l->t('Organization'); ?></option>
+ <?php echo html_select_options($_['property_types'], 'EMAIL') ?>
</select>
</p>
<p class="contacts_property_data" id="contacts_generic">
<input type="text" name="value" value="">
- </p><br>
+ </p>
+ <br>
<input id="contacts_addproperty_button" type="submit" value="<?php echo $l->t('Add'); ?>">
</form>
<div id="contacts_addcontactsparts" style="display:none;">
@@ -43,8 +41,7 @@
<li>
<label for="adr_type"><?php echo $l->t('Type'); ?></label>
<select id="adr_type" name="parameters[TYPE]" size="1">
- <option value="work"><?php echo $l->t('Work'); ?></option>
- <option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
+ <?php echo html_select_options($_['adr_types'], 'HOME') ?>
</select>
</li>
<li>
@@ -79,14 +76,7 @@
<p class="contacts_property_data" id="contacts_phonepart">
<input type="text" name="value" value="">
<select name="parameters[TYPE]" size="1">
- <option value="home"><?php echo $l->t('Home'); ?></option>
- <option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
- <option value="work"><?php echo $l->t('Work'); ?></option>
- <option value="text"><?php echo $l->t('Text'); ?></option>
- <option value="voice"><?php echo $l->t('Voice'); ?></option>
- <option value="fax"><?php echo $l->t('Fax'); ?></option>
- <option value="video"><?php echo $l->t('Video'); ?></option>
- <option value="pager"><?php echo $l->t('Pager'); ?></option>
+ <?php echo html_select_options($_['phone_types'], 'CELL') ?>
</select>
</p>
<p class="contacts_property_data" id="contacts_generic">
diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php
index afdba2bd759..811b9626ce4 100644
--- a/apps/contacts/templates/part.setpropertyform.php
+++ b/apps/contacts/templates/part.setpropertyform.php
@@ -5,42 +5,48 @@
<?php if($_['property']['name']=='ADR'): ?>
<p class="contacts_property_name"><label for="adr_pobox"><?php echo $l->t('Address'); ?></label></p>
<ol class="contacts_property_data" id="contacts_addresspart">
+ <li class="input">
+ <label class="label" for="adr_type"><?php echo $l->t('Type'); ?></label>
+ <select id="adr_type" name="parameters[TYPE]" size="1">
+ <?php echo html_select_options($_['adr_types'], strtoupper($_['property']['parameters']['TYPE'])) ?>
+ </select>
+ </li>
<li>
<label for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
- <input id="adr_pobox" type="text" name="value[0]" value="">
+ <input id="adr_pobox" type="text" name="value[0]" value="<?php echo $_['property']['value'][0] ?>">
</li>
<li>
<label for="adr_extended"><?php echo $l->t('Extended'); ?></label>
- <input id="adr_extended" type="text" name="value[1]" value="">
+ <input id="adr_extended" type="text" name="value[1]" value="<?php echo $_['property']['value'][1] ?>">
</li>
<li>
<label for="adr_street"><?php echo $l->t('Street'); ?></label>
- <input id="adr_street" type="text" name="value[2]" value="">
+ <input id="adr_street" type="text" name="value[2]" value="<?php echo $_['property']['value'][2] ?>">
</li>
<li>
<label for="adr_city"><?php echo $l->t('City'); ?></label>
- <input id="adr_city" type="text" name="value[3]" value="">
+ <input id="adr_city" type="text" name="value[3]" value="<?php echo $_['property']['value'][3] ?>">
</li>
<li>
<label for="adr_region"><?php echo $l->t('Region'); ?></label>
- <input id="adr_region" type="text" name="value[4]" value="">
+ <input id="adr_region" type="text" name="value[4]" value="<?php echo $_['property']['value'][4] ?>">
</li>
<li>
<label for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
- <input id="adr_zipcode" type="text" name="value[5]" value="">
+ <input id="adr_zipcode" type="text" name="value[5]" value="<?php echo $_['property']['value'][5] ?>">
</li>
<li>
<label for="adr_country"><?php echo $l->t('Country'); ?></label>
- <input id="adr_country" type="text" name="value[6]" value="">
+ <input id="adr_country" type="text" name="value[6]" value="<?php echo $_['property']['value'][6] ?>">
</li>
</ol>
<?php elseif($_['property']['name']=='TEL'): ?>
- <p class="contacts_property_name"><label for="tel"><?php echo $l->t('Address'); ?></label></p>
+ <p class="contacts_property_name"><label for="tel"><?php echo $l->t('Phone'); ?></label></p>
<p class="contacts_property_data"><input id="tel" type="phone" name="value" value="<?php echo $_['property']['value']; ?>"></p>
<?php elseif($_['property']['name']=='EMAIL'): ?>
<p class="contacts_property_name"><label for="email"><?php echo $l->t('Email'); ?></label></p>
<p class="contacts_property_data"><input id="email" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
- <?php elseif($_['property']['name']=='EMAIL'): ?>
+ <?php elseif($_['property']['name']=='ORG'): ?>
<p class="contacts_property_name"><label for="org"><?php echo $l->t('Organization'); ?></label></p>
<p class="contacts_property_data"><input id="org" type="text" name="value" value="<?php echo $_['property']['value']; ?>"></p>
<?php endif; ?>
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index c0fc91e92ad..4056d693bfa 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -10,7 +10,7 @@ $(document).ready(function() {
type: 'GET',
url: OC.linkTo('files_sharing', 'ajax/getitem.php'),
dataType: 'json',
- data: 'source='+file,
+ data: {source: file},
async: false,
success: function(users) {
if (users) {
@@ -46,6 +46,7 @@ $(document).ready(function() {
$('.share').click(function(event) {
event.preventDefault();
+ event.stopPropagation();
var filenames = getSelectedFiles('name');
var length = filenames.length;
var files = '';
@@ -184,8 +185,8 @@ function createDropdown(filename, files) {
html += '<input id="link" style="display:none; width:90%;" />';
html += '</div>';
if (filename) {
- $('tr[data-file="'+filename+'"]').addClass('mouseOver');
- $(html).appendTo($('tr[data-file="'+filename+'"] td.filename'));
+ $('tr').filterAttr('data-file',filename).addClass('mouseOver');
+ $(html).appendTo($('tr').filterAttr('data-file',filename).find('td.filename'));
} else {
$(html).appendTo($('thead .share'));
}
diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php
index 571cb7e6850..caa3ac3f479 100644
--- a/apps/media/lib_collection.php
+++ b/apps/media/lib_collection.php
@@ -267,7 +267,7 @@ class OC_MEDIA_COLLECTION{
$query=self::$queries['addsong'];
}
$query->execute(array($name,$artist,$album,$path,$uid,$length,$track,$size));
- $songId=OC_DB::insertid();
+ $songId=OC_DB::insertid('*PREFIX*media_songs');
// self::setLastUpdated();
return self::getSongId($name,$artist,$album);
}
diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php
index f10a72870a4..4bbadafe7d2 100644
--- a/apps/remoteStorage/lib_remoteStorage.php
+++ b/apps/remoteStorage/lib_remoteStorage.php
@@ -4,12 +4,6 @@ class OC_remoteStorage {
public static function getValidTokens($ownCloudUser, $userAddress, $dataScope) {
$query=OC_DB::prepare("SELECT token,appUrl FROM *PREFIX*authtoken WHERE user=? AND userAddress=? AND dataScope=? LIMIT 100");
$result=$query->execute(array($ownCloudUser,$userAddress,$dataScope));
- if( PEAR::isError($result)) {
- $entry = 'DB Error: "'.$result->getMessage().'"<br />';
- $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
- die( $entry );
- }
$ret = array();
while($row=$result->fetchRow()){
$ret[$row['token']]=$userAddress;
@@ -21,12 +15,6 @@ class OC_remoteStorage {
$user=OC_User::getUser();
$query=OC_DB::prepare("SELECT token,appUrl,userAddress,dataScope FROM *PREFIX*authtoken WHERE user=? LIMIT 100");
$result=$query->execute(array($user));
- if( PEAR::isError($result)) {
- $entry = 'DB Error: "'.$result->getMessage().'"<br />';
- $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
- die( $entry );
- }
$ret = array();
while($row=$result->fetchRow()){
$ret[$row['token']] = array(
@@ -42,23 +30,11 @@ class OC_remoteStorage {
$user=OC_User::getUser();
$query=OC_DB::prepare("DELETE FROM *PREFIX*authtoken WHERE token=? AND user=?");
$result=$query->execute(array($token,$user));
- if( PEAR::isError($result)) {
- $entry = 'DB Error: "'.$result->getMessage().'"<br />';
- $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
- die( $entry );
- }
}
private static function addToken($token, $appUrl, $userAddress, $dataScope){
$user=OC_User::getUser();
$query=OC_DB::prepare("INSERT INTO *PREFIX*authtoken (`token`,`appUrl`,`user`,`userAddress`,`dataScope`) VALUES(?,?,?,?,?)");
$result=$query->execute(array($token,$appUrl,$user,$userAddress,$dataScope));
- if( PEAR::isError($result)) {
- $entry = 'DB Error: "'.$result->getMessage().'"<br />';
- $entry .= 'Offending command was: '.$result->getDebugInfo().'<br />';
- OC_Log::write('removeStorage',$entry,OC_Log::ERROR);
- die( $entry );
- }
}
public static function createDataScope($appUrl, $userAddress, $dataScope){
$token=uniqid();
diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php
index afb53689682..349afaba507 100644
--- a/apps/user_webfinger/webfinger.php
+++ b/apps/user_webfinger/webfinger.php
@@ -4,7 +4,14 @@ if($_SERVER['SCRIPT_NAME'] == '/.well-known/webfinger.php') {
} else {
header('Please-first: activate');
}
-header("Content-Type: application/xml+xrd");
+// header("Content-Type: application/xml+xrd");
+
+// calculate the documentroot
+// modified version of the one in lib/base.php that takes the .well-known symlink into account
+$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
+$SERVERROOT=str_replace("\\",'/',dirname(dirname(dirname(dirname(__FILE__)))));
+$SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT));
+$WEBROOT=substr($SUBURI,0,-34);
if($_GET['q']) {
$bits = explode('@', $_GET['q']);
@@ -20,5 +27,5 @@ echo "<";
?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
- <Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
+ <Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'].$WEBROOT ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
</XRD>