From 715e376cd2cc6bb2a65be0720c6c1fff0acaa5b9 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Tue, 25 Oct 2011 20:01:40 +0200 Subject: Fix setproperty form --- apps/contacts/templates/part.setpropertyform.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apps') diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php index afdba2bd759..eb8a67a8aa5 100644 --- a/apps/contacts/templates/part.setpropertyform.php +++ b/apps/contacts/templates/part.setpropertyform.php @@ -7,40 +7,40 @@
  1. - +
  2. - +
  3. - +
  4. - +
  5. - +
  6. - +
  7. - +
-

+

- +

-- cgit v1.2.3 From c0e9c805eceb24d25a57806684d9b5e3e5795e43 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 27 Oct 2011 22:46:52 +0200 Subject: Disable loading non-existing settings script in bookmark app --- apps/bookmarks/settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') 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(); -- cgit v1.2.3 From 6d4d15b221443e0cfb375f9870e34e825cc79c37 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 27 Oct 2011 22:47:56 +0200 Subject: Fix html id's in part.addcardform.php --- apps/contacts/templates/part.addcardform.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php index 8e482cc4eba..a596ad8163a 100644 --- a/apps/contacts/templates/part.addcardform.php +++ b/apps/contacts/templates/part.addcardform.php @@ -19,7 +19,7 @@
  1. -
    +
  2. @@ -81,19 +81,19 @@
  3. - +
  4. - +
  5. - +
  6. - +
  7. -- cgit v1.2.3 From a809fe9a048d53c23bb962da5f1b133f4aac82b8 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 00:27:25 +0200 Subject: Add a dependencies check apps --- apps/dependencies_chk/appinfo/app.php | 9 +++ apps/dependencies_chk/appinfo/info.xml | 11 ++++ apps/dependencies_chk/css/style.css | 9 +++ apps/dependencies_chk/settings.php | 91 ++++++++++++++++++++++++++++ apps/dependencies_chk/templates/settings.php | 16 +++++ 5 files changed, 136 insertions(+) create mode 100644 apps/dependencies_chk/appinfo/app.php create mode 100644 apps/dependencies_chk/appinfo/info.xml create mode 100644 apps/dependencies_chk/css/style.css create mode 100644 apps/dependencies_chk/settings.php create mode 100644 apps/dependencies_chk/templates/settings.php (limited to 'apps') diff --git a/apps/dependencies_chk/appinfo/app.php b/apps/dependencies_chk/appinfo/app.php new file mode 100644 index 00000000000..dea2cd39f83 --- /dev/null +++ b/apps/dependencies_chk/appinfo/app.php @@ -0,0 +1,9 @@ + 14, + 'id' => 'dependencies_chk', + 'name' => 'Owncloud Install Info' )); + +OC_APP::registerAdmin('dependencies_chk','settings'); diff --git a/apps/dependencies_chk/appinfo/info.xml b/apps/dependencies_chk/appinfo/info.xml new file mode 100644 index 00000000000..38a6dee2562 --- /dev/null +++ b/apps/dependencies_chk/appinfo/info.xml @@ -0,0 +1,11 @@ + + + dependencies_chk + Owncloud dependencies info + 0.01 + MIT + Brice Maron (eMerzh) + 2 + Display OwnCloud's dependencies informations (missings modules, ...) + + diff --git a/apps/dependencies_chk/css/style.css b/apps/dependencies_chk/css/style.css new file mode 100644 index 00000000000..30f204be7bc --- /dev/null +++ b/apps/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/dependencies_chk/settings.php b/apps/dependencies_chk/settings.php new file mode 100644 index 00000000000..ca609532159 --- /dev/null +++ b/apps/dependencies_chk/settings.php @@ -0,0 +1,91 @@ +. + * + */ +$l=new OC_L10N('dependencies_chk'); +$tmpl = new OC_Template( '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 application 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.')); + + +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('dependencies_chk', 'style'); +$tmpl->assign( 'items', $modules ); + +return $tmpl->fetchPage(); diff --git a/apps/dependencies_chk/templates/settings.php b/apps/dependencies_chk/templates/settings.php new file mode 100644 index 00000000000..8ff27ebb187 --- /dev/null +++ b/apps/dependencies_chk/templates/settings.php @@ -0,0 +1,16 @@ +
    + t('Dependencies status');?> +
      + +
    • + +
      t('Used by :');?> +
        + +
      • + +
      +
    • + +
    +
    \ No newline at end of file -- cgit v1.2.3 From a21908cf18fe139976a4eec494c0dce037c08841 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 10:07:01 +0200 Subject: Change name and fix a typo --- apps/admin_dependencies_chk/appinfo/app.php | 9 +++ apps/admin_dependencies_chk/appinfo/info.xml | 11 +++ apps/admin_dependencies_chk/css/style.css | 9 +++ apps/admin_dependencies_chk/settings.php | 91 ++++++++++++++++++++++ apps/admin_dependencies_chk/templates/settings.php | 16 ++++ apps/dependencies_chk/appinfo/app.php | 9 --- apps/dependencies_chk/appinfo/info.xml | 11 --- apps/dependencies_chk/css/style.css | 9 --- apps/dependencies_chk/settings.php | 91 ---------------------- apps/dependencies_chk/templates/settings.php | 16 ---- 10 files changed, 136 insertions(+), 136 deletions(-) create mode 100644 apps/admin_dependencies_chk/appinfo/app.php create mode 100644 apps/admin_dependencies_chk/appinfo/info.xml create mode 100644 apps/admin_dependencies_chk/css/style.css create mode 100644 apps/admin_dependencies_chk/settings.php create mode 100644 apps/admin_dependencies_chk/templates/settings.php delete mode 100644 apps/dependencies_chk/appinfo/app.php delete mode 100644 apps/dependencies_chk/appinfo/info.xml delete mode 100644 apps/dependencies_chk/css/style.css delete mode 100644 apps/dependencies_chk/settings.php delete mode 100644 apps/dependencies_chk/templates/settings.php (limited to 'apps') 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 @@ + 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..7216a1ee862 --- /dev/null +++ b/apps/admin_dependencies_chk/appinfo/info.xml @@ -0,0 +1,11 @@ + + + admin_dependencies_chk + Owncloud dependencies info + 0.01 + MIT + Brice Maron (eMerzh) + 2 + Display OwnCloud's dependencies informations (missings modules, ...) + + 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..a3c93964977 --- /dev/null +++ b/apps/admin_dependencies_chk/settings.php @@ -0,0 +1,91 @@ +. + * + */ +$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.')); + + +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 @@ +
    + t('Dependencies status');?> +
      + +
    • + +
      t('Used by :');?> +
        + +
      • + +
      +
    • + +
    +
    \ No newline at end of file diff --git a/apps/dependencies_chk/appinfo/app.php b/apps/dependencies_chk/appinfo/app.php deleted file mode 100644 index dea2cd39f83..00000000000 --- a/apps/dependencies_chk/appinfo/app.php +++ /dev/null @@ -1,9 +0,0 @@ - 14, - 'id' => 'dependencies_chk', - 'name' => 'Owncloud Install Info' )); - -OC_APP::registerAdmin('dependencies_chk','settings'); diff --git a/apps/dependencies_chk/appinfo/info.xml b/apps/dependencies_chk/appinfo/info.xml deleted file mode 100644 index 38a6dee2562..00000000000 --- a/apps/dependencies_chk/appinfo/info.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - dependencies_chk - Owncloud dependencies info - 0.01 - MIT - Brice Maron (eMerzh) - 2 - Display OwnCloud's dependencies informations (missings modules, ...) - - diff --git a/apps/dependencies_chk/css/style.css b/apps/dependencies_chk/css/style.css deleted file mode 100644 index 30f204be7bc..00000000000 --- a/apps/dependencies_chk/css/style.css +++ /dev/null @@ -1,9 +0,0 @@ -#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/dependencies_chk/settings.php b/apps/dependencies_chk/settings.php deleted file mode 100644 index ca609532159..00000000000 --- a/apps/dependencies_chk/settings.php +++ /dev/null @@ -1,91 +0,0 @@ -. - * - */ -$l=new OC_L10N('dependencies_chk'); -$tmpl = new OC_Template( '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 application 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.')); - - -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('dependencies_chk', 'style'); -$tmpl->assign( 'items', $modules ); - -return $tmpl->fetchPage(); diff --git a/apps/dependencies_chk/templates/settings.php b/apps/dependencies_chk/templates/settings.php deleted file mode 100644 index 8ff27ebb187..00000000000 --- a/apps/dependencies_chk/templates/settings.php +++ /dev/null @@ -1,16 +0,0 @@ -
    - t('Dependencies status');?> -
      - -
    • - -
      t('Used by :');?> -
        - -
      • - -
      -
    • - -
    -
    \ No newline at end of file -- cgit v1.2.3 From eaad3ab45fa8a1d33a24afd7147b674aa79434ee Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 10:15:29 +0200 Subject: Be consistent with licencing --- apps/admin_dependencies_chk/appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/admin_dependencies_chk/appinfo/info.xml b/apps/admin_dependencies_chk/appinfo/info.xml index 7216a1ee862..10721ece15b 100644 --- a/apps/admin_dependencies_chk/appinfo/info.xml +++ b/apps/admin_dependencies_chk/appinfo/info.xml @@ -3,7 +3,7 @@ admin_dependencies_chk Owncloud dependencies info 0.01 - MIT + AGPL Brice Maron (eMerzh) 2 Display OwnCloud's dependencies informations (missings modules, ...) -- cgit v1.2.3 From e533e82bc9526ef9869b20e99b745c210348218f Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sat, 29 Oct 2011 11:40:48 +0200 Subject: Add sequence name in insertid to be more portable --- apps/bookmarks/ajax/addBookmark.php | 8 +------- apps/calendar/lib/calendar.php | 4 ++-- apps/calendar/lib/object.php | 4 ++-- apps/contacts/lib/addressbook.php | 4 ++-- apps/contacts/lib/vcard.php | 4 ++-- apps/media/lib_collection.php | 2 +- lib/db.php | 10 ++++++++-- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'apps') 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/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php index c19c0e73c08..f6d40aa534e 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 0c3e497d4f2..33871cd3185 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -78,7 +78,7 @@ class OC_Calendar_Object{ OC_Calendar_Calendar::touchCalendar($id); - return OC_DB::insertid(); + return OC_DB::insertid('*PREFIX*calendar_objects'); } /** @@ -97,7 +97,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/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..adfa32b6f5f 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -121,7 +121,7 @@ class OC_Contacts_VCard{ OC_Contacts_Addressbook::touch($id); - return OC_DB::insertid(); + return OC_DB::insertid('*PREFIX*contacts_cards'); } /** @@ -147,7 +147,7 @@ class OC_Contacts_VCard{ OC_Contacts_Addressbook::touch($id); - return OC_DB::insertid(); + return OC_DB::insertid('*PREFIX*contacts_cards'); } /** 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/lib/db.php b/lib/db.php index 421b08c2320..c059f5ab336 100644 --- a/lib/db.php +++ b/lib/db.php @@ -224,6 +224,7 @@ class OC_DB { /** * @brief gets last value of autoincrement + * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix * @returns id * * MDB2 lastInsertID() @@ -231,9 +232,14 @@ class OC_DB { * Call this method right after the insert command or other functions may * cause trouble! */ - public static function insertid(){ + public static function insertid($table=null){ self::connect(); - return self::$connection->lastInsertId(); + if($table !== null){ + $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); + $suffix = OC_Config::getValue( "dbsequencesuffix", "_id_seq" ); + $table = str_replace( '*PREFIX*', $prefix, $table ); + } + return self::$connection->lastInsertId($table.$suffix); } /** -- cgit v1.2.3 From c7d1737d47c1846beee5d145dd73dd7924a6eea9 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 1 Nov 2011 22:35:13 +0100 Subject: attempt to manage some special chars in file list Added a jquery function to filter by attributes. Add more logging in rename file Use the new function to avoid errors --- apps/files_sharing/js/share.js | 6 ++--- core/js/js.js | 7 ++++++ files/js/fileactions.js | 2 +- files/js/filelist.js | 54 ++++++++++++++++++++++++------------------ files/js/files.js | 11 ++++++--- files/templates/part.list.php | 2 +- lib/filestorage/local.php | 5 ++++ 7 files changed, 56 insertions(+), 31 deletions(-) (limited to 'apps') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index c0fc91e92ad..131571351c5 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) { @@ -184,8 +184,8 @@ function createDropdown(filename, files) { html += ''; html += ''; 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/core/js/js.js b/core/js/js.js index 9e814ca0729..440f504c8f7 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -401,3 +401,10 @@ if (!Array.prototype.map){ return res; }; } + +/** + * Filter Jquery selector by attribute value + **/ +$.fn.filterAttr = function(attr_name, attr_value) { + return this.filter(function() { return $(this).attr(attr_name) === attr_value; }); +}; diff --git a/files/js/fileactions.js b/files/js/fileactions.js index f95c5e84dc1..9e2688e82c1 100644 --- a/files/js/fileactions.js +++ b/files/js/fileactions.js @@ -56,7 +56,7 @@ FileActions={ $('#fileList .action').remove(); var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); var file=FileActions.getCurrentFile(); - if($('tr[data-file="'+file+'"]').data('renaming')){ + if($('tr').filterAttr('data-file',file).data('renaming')){ return; } var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType()); diff --git a/files/js/filelist.js b/files/js/filelist.js index 863a3385d15..5740ece9716 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -4,7 +4,7 @@ FileList={ }, addFile:function(name,size,lastModified,loading){ var img=(loading)?OC.imagePath('core', 'loading.gif'):OC.imagePath('core', 'filetypes/file.png'); - var html=''; + var html=''; if(name.indexOf('.')!=-1){ var basename=name.substr(0,name.lastIndexOf('.')); var extention=name.substr(name.lastIndexOf('.')); @@ -29,16 +29,21 @@ FileList={ html+=''+simpleSize+''; html+=''+relative_modified_date(lastModified.getTime() / 1000)+''; html+=''; - FileList.insertElement(name,'file',$(html)); + FileList.insertElement(name,'file',$(html).attr('data-file',name)); if(loading){ - $('tr[data-file="'+name+'"]').data('loading',true); + $('tr').filterAttr('data-file',name).data('loading',true); }else{ - $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions); + $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); } }, addDir:function(name,size,lastModified){ - var html=''; - html+=''+name+''; + html = $('').attr({ "data-type": "dir", "data-size": size, "data-file": name}); + td = $('').attr({"class": "filename", "style": 'background-image:url('+OC.imagePath('core', 'filetypes/folder.png')+')' }); + td.append(''); + var link_elem = $('').attr({ "class": "name", "href": "index.php?dir="+ encodeURIComponent($('#dir').val()+'/'+name) }); + link_elem.append($('').addClass('nametext').text(name)); + td.append(link_elem); + html.append(td); if(size!='Pending'){ simpleSize=simpleFileSize(size); }else{ @@ -47,13 +52,15 @@ FileList={ sizeColor = Math.round(200-Math.pow((size/(1024*1024)),2)); lastModifiedTime=Math.round(lastModified.getTime() / 1000); modifiedColor=Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5); - html+=''+simpleSize+''; - html+=''+relative_modified_date(lastModified.getTime() / 1000)+''; - html+=''; + td = $('').attr({ "class": "filesize", "title": humanFileSize(size), "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'}).text(simpleSize); + html.append(td); - FileList.insertElement(name,'dir',$(html)); - $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions); - $('tr[data-file="'+name+'"] td.filename').droppable(folderDropOptions); + td = $('').attr({ "class": "date" }); + td.append($('').attr({ "class": "modified", "title": formatDate(lastModified), "style": 'color:rgb('+modifiedColor+','+modifiedColor+','+modifiedColor+')' }).text( relative_modified_date(lastModified.getTime() / 1000) )); + html.append(td); + FileList.insertElement(name,'dir',html); + $('tr').filterAttr('data-file',name).find('td.filename').draggable(dragOptions); + $('tr').filterAttr('data-file',name).find('td.filename').droppable(folderDropOptions); }, refresh:function(data) { result = jQuery.parseJSON(data.responseText); @@ -64,8 +71,8 @@ FileList={ resetFileActionPanel(); }, remove:function(name){ - $('tr[data-file="'+name+'"] td.filename').draggable('destroy'); - $('tr[data-file="'+name+'"]').remove(); + $('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy'); + $('tr').filterAttr('data-file',name).remove(); if($('tr[data-file]').length==0){ $('#emptyfolder').show(); $('.file_upload_filename').addClass('highlight'); @@ -101,7 +108,7 @@ FileList={ $('.file_upload_filename').removeClass('highlight'); }, loadingDone:function(name){ - var tr=$('tr[data-file="'+name+'"]'); + var tr=$('tr').filterAttr('data-file',name); tr.data('loading',false); var mime=tr.data('mime'); tr.attr('data-mime',mime); @@ -111,13 +118,13 @@ FileList={ tr.find('td.filename').draggable(dragOptions); }, isLoading:function(name){ - return $('tr[data-file="'+name+'"]').data('loading'); + return $('tr').filterAttr('data-file',name).data('loading'); }, rename:function(name){ - var tr=$('tr[data-file="'+name+'"]'); + var tr=$('tr').filterAttr('data-file',name); tr.data('renaming',true); var td=tr.children('td.filename'); - var input=$(''); + var input=$('').val(name); var form=$('
    ') form.append(input); td.children('a.name').text(''); @@ -143,7 +150,7 @@ FileList={ } $.ajax({ url: 'ajax/rename.php', - data: "dir="+$('#dir').val()+"&newname="+encodeURIComponent(newname)+"&file="+encodeURIComponent(name) + data: { dir : $('#dir').val(), newname: newname, file: name } }); }); form.click(function(event){ @@ -165,9 +172,10 @@ FileList={ files=[files]; } $.each(files,function(index,file){ - $('tr[data-file="'+file+'"]').hide(); - $('tr[data-file="'+file+'"]').find('input[type="checkbox"]').removeAttr('checked'); - $('tr[data-file="'+file+'"]').removeClass('selected'); + var files = $('tr').filterAttr('data-file',file); + files.hide(); + files.find('input[type="checkbox"]').removeAttr('checked'); + files.removeClass('selected'); }); procesSelection(); FileList.deleteCanceled=false; @@ -208,7 +216,7 @@ $(document).ready(function(){ if($('#notification').data('deletefile')) { $.each(FileList.deleteFiles,function(index,file){ - $('tr[data-file="'+file+'"]').show(); + $('tr').filterAttr('data-file',file).show(); // alert(file); }); FileList.deleteCanceled=true; diff --git a/files/js/files.js b/files/js/files.js index 902c5e54934..593eeafde85 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -1,4 +1,9 @@ $(document).ready(function() { + $('#fileList tr').each(function(){ + //little hack to set unescape filenames in attribute + $(this).attr('data-file',unescape($(this).data('file'))); + }); + if($('tr[data-file]').length==0){ $('.file_upload_filename').addClass('highlight'); } @@ -185,9 +190,9 @@ $(document).ready(function() { if(response[0] != undefined && response[0].status == 'success'){ for(var i=0;i200) $relative_date_color = 200; ?> - '> + '> diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 01523b6b0b3..9e29f85071a 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -84,6 +84,11 @@ class OC_Filestorage_Local extends OC_Filestorage{ return $return; } public function rename($path1,$path2){ + if(! $this->file_exists($path1)){ + OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR); + return false; + } + if($return=rename($this->datadir.$path1,$this->datadir.$path2)){ $this->clearFolderSizeCache($path1); $this->clearFolderSizeCache($path2); -- cgit v1.2.3 From e2907eb99db54090ded8332bee5ebb7c94e08b2f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 3 Nov 2011 12:47:12 +0100 Subject: no longer rely on PEAR::isError since we can use PDO now --- apps/remoteStorage/lib_remoteStorage.php | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'apps') 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().'"
    '; - $entry .= 'Offending command was: '.$result->getDebugInfo().'
    '; - 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().'"
    '; - $entry .= 'Offending command was: '.$result->getDebugInfo().'
    '; - 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().'"
    '; - $entry .= 'Offending command was: '.$result->getDebugInfo().'
    '; - 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().'"
    '; - $entry .= 'Offending command was: '.$result->getDebugInfo().'
    '; - OC_Log::write('removeStorage',$entry,OC_Log::ERROR); - die( $entry ); - } } public static function createDataScope($appUrl, $userAddress, $dataScope){ $token=uniqid(); -- cgit v1.2.3 From 8eda6f8febcd8e7320d758e512d2d887d86debb0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 3 Nov 2011 13:09:44 +0100 Subject: make webfinger work properly if owncloud is installed in a subdirectory --- apps/user_webfinger/webfinger.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apps') 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"?> - + -- cgit v1.2.3 From cc35cb74e191040169100021c906cc8267b3508e Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sun, 6 Nov 2011 15:29:51 +0100 Subject: Try to avoid closing the share box too soon on multiple selections --- apps/files_sharing/js/share.js | 1 + 1 file changed, 1 insertion(+) (limited to 'apps') diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 131571351c5..4056d693bfa 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -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 = ''; -- cgit v1.2.3 From 97291fda5829fd56a22e39b6a62681aaa239bef5 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sun, 6 Nov 2011 16:54:05 +0100 Subject: Add allow_url_fopen directive to admin_dependencies_chk --- apps/admin_dependencies_chk/settings.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apps') diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php index a3c93964977..de2f97aa79d 100644 --- a/apps/admin_dependencies_chk/settings.php +++ b/apps/admin_dependencies_chk/settings.php @@ -74,6 +74,11 @@ $modules[] =array( '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 ; -- cgit v1.2.3 From 841be90939a74048b0cba9e2085d4853a8a7c5bf Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Sun, 23 Oct 2011 11:35:47 +0200 Subject: Improve style in contacts --- apps/contacts/css/styles.css | 2 +- apps/contacts/js/interface.js | 6 +++--- apps/contacts/templates/part.details.php | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'apps') diff --git a/apps/contacts/css/styles.css b/apps/contacts/css/styles.css index 68f843b7aaf..e2e673346c6 100644 --- a/apps/contacts/css/styles.css +++ b/apps/contacts/css/styles.css @@ -6,7 +6,7 @@ #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_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/templates/part.details.php b/apps/contacts/templates/part.details.php index e9fa8356e8b..212be283d80 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -35,7 +35,8 @@

    -


    +

    +
@@ -46,14 +44,7 @@
  • @@ -67,8 +58,7 @@
  • diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 212be283d80..f5bd75809b1 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -27,10 +27,7 @@

    @@ -44,8 +41,7 @@

  • @@ -80,14 +76,7 @@

    diff --git a/apps/contacts/templates/part.setpropertyform.php b/apps/contacts/templates/part.setpropertyform.php index eb8a67a8aa5..811b9626ce4 100644 --- a/apps/contacts/templates/part.setpropertyform.php +++ b/apps/contacts/templates/part.setpropertyform.php @@ -5,6 +5,12 @@

      +
    1. + + +
    2. diff --git a/lib/template.php b/lib/template.php index 440b62003e7..d1439199e1e 100644 --- a/lib/template.php +++ b/lib/template.php @@ -98,6 +98,33 @@ function relative_modified_date($timestamp) { else { return $l->t('years ago'); } } +function html_select_options($options, $selected, $params=array()) { + if (!is_array($selected)){ + $selected=array($selected); + } + if (isset($params['combine']) && $params['combine']){ + $options = array_combine($options, $options); + } + $value_name = $label_name = false; + if (isset($params['value'])){ + $value_name = $params['value']; + } + if (isset($params['label'])){ + $label_name = $params['label']; + } + $html = ''; + foreach($options as $value => $label){ + if ($value_name && is_array($label)){ + $value = $label[$value_name]; + } + if ($label_name && is_array($label)){ + $label = $label[$label_name]; + } + $select = in_array($value, $selected) ? ' selected="selected"' : ''; + $html .= ''; + } + return $html; +} /** * This class provides the templates for owncloud. -- cgit v1.2.3