Merge branch 'master' into subadmin

remotes/origin/stable45
Georg Ehrke 13 years ago
commit f0c82686fd
  1. 2
      apps/calendar/ajax/calendar/activation.php
  2. 1
      apps/calendar/ajax/calendar/delete.php
  3. 3
      apps/calendar/ajax/calendar/new.php
  4. 1
      apps/calendar/ajax/calendar/update.php
  5. 1
      apps/calendar/ajax/categories/rescan.php
  6. 1
      apps/calendar/ajax/event/delete.php
  7. 1
      apps/calendar/ajax/event/edit.php
  8. 1
      apps/calendar/ajax/event/move.php
  9. 1
      apps/calendar/ajax/event/new.php
  10. 1
      apps/calendar/ajax/event/resize.php
  11. 1
      apps/calendar/ajax/import/import.php
  12. 1
      apps/calendar/ajax/settings/setfirstday.php
  13. 1
      apps/calendar/ajax/settings/settimeformat.php
  14. 1
      apps/calendar/ajax/settings/settimezone.php
  15. 1
      apps/calendar/appinfo/app.php
  16. 13
      apps/calendar/lib/hooks.php
  17. 8
      apps/calendar/templates/calendar.php
  18. 3
      apps/contacts/ajax/categories/delete.php
  19. 1
      apps/contacts/ajax/categories/rescan.php
  20. 3
      apps/contacts/ajax/contactdetails.php
  21. 11
      apps/contacts/ajax/saveproperty.php
  22. 2
      apps/contacts/appinfo/update.php
  23. 2
      apps/contacts/css/contacts.css
  24. 5
      apps/contacts/import.php
  25. 57
      apps/contacts/js/contacts.js
  26. 6
      apps/contacts/lib/hooks.php
  27. 2
      apps/contacts/lib/vcard.php
  28. 2
      apps/files_sharing_log/appinfo/database.xml
  29. 1
      apps/files_versions/ajax/expireAll.php
  30. 1
      apps/files_versions/ajax/rollbackVersion.php
  31. 1
      apps/files_versions/ajax/togglesettings.php
  32. 3
      apps/remoteStorage/appinfo/info.xml
  33. 2
      apps/remoteStorage/appinfo/version
  34. 6
      apps/remoteStorage/appinfo/webfinger.php
  35. 30
      apps/remoteStorage/webdav.php
  36. 1
      apps/tasks/ajax/addtask.php
  37. 1
      apps/tasks/ajax/delete.php
  38. 1
      apps/tasks/ajax/edittask.php
  39. 1
      apps/tasks/ajax/update_property.php
  40. 5
      apps/user_webfinger/.htaccess
  41. 19
      apps/user_webfinger/host-meta.php
  42. 95
      autotest.sh
  43. 5
      lib/connector/sabre/auth.php
  44. 2
      lib/connector/sabre/file.php
  45. 7
      lib/l10n.php
  46. 2
      lib/user.php
  47. 10
      tests/index.php

@ -9,6 +9,8 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$calendarid = $_POST['calendarid']; $calendarid = $_POST['calendarid'];
$calendar = OC_Calendar_App::getCalendar($calendarid, true); $calendar = OC_Calendar_App::getCalendar($calendarid, true);
if(!$calendar){ if(!$calendar){

@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$cal = $_POST["calendarid"]; $cal = $_POST["calendarid"];
$calendar = OC_Calendar_App::getCalendar($cal, true); $calendar = OC_Calendar_App::getCalendar($cal, true);

@ -6,11 +6,10 @@
* See the COPYING-README file. * See the COPYING-README file.
*/ */
// Check if we are a user // Check if we are a user
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
if(trim($_POST['name']) == ''){ if(trim($_POST['name']) == ''){
OCP\JSON::error(array('message'=>'empty')); OCP\JSON::error(array('message'=>'empty'));

@ -11,6 +11,7 @@
// Check if we are a user // Check if we are a user
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
if(trim($_POST['name']) == ''){ if(trim($_POST['name']) == ''){
OCP\JSON::error(array('message'=>'empty')); OCP\JSON::error(array('message'=>'empty'));

@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
foreach ($_POST as $key=>$element) { foreach ($_POST as $key=>$element) {
debug('_POST: '.$key.'=>'.print_r($element, true)); debug('_POST: '.$key.'=>'.print_r($element, true));

@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);

@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];

@ -7,6 +7,7 @@
*/ */
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];
$access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT);

@ -10,6 +10,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
$errarr = OC_Calendar_Object::validateRequest($_POST); $errarr = OC_Calendar_Object::validateRequest($_POST);
if($errarr){ if($errarr){

@ -7,6 +7,7 @@
*/ */
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];

@ -10,6 +10,7 @@ ob_start();
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('calendar'); OCP\App::checkAppEnabled('calendar');
OCP\JSON::callCheck();
session_write_close(); session_write_close();
$nl="\r\n"; $nl="\r\n";

@ -7,6 +7,7 @@
*/ */
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
if(isset($_POST["firstday"])){ if(isset($_POST["firstday"])){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]); OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'firstday', $_POST["firstday"]);
OCP\JSON::success(); OCP\JSON::success();

@ -7,6 +7,7 @@
*/ */
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
if(isset($_POST["timeformat"])){ if(isset($_POST["timeformat"])){
OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]); OCP\Config::setUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', $_POST["timeformat"]);
OCP\JSON::success(); OCP\JSON::success();

@ -14,6 +14,7 @@ $l=OC_L10N::get('calendar');
// Check if we are a user // Check if we are a user
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar'); OCP\JSON::checkAppEnabled('calendar');
OCP\JSON::callCheck();
// Get data // Get data
if( isset( $_POST['timezone'] ) ){ if( isset( $_POST['timezone'] ) ){

@ -10,6 +10,7 @@ OC::$CLASSPATH['OC_Calendar_Share'] = 'apps/calendar/lib/share.php';
OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php'; OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php';
OC::$CLASSPATH['OC_Calendar_Export'] = 'apps/calendar/lib/export.php'; OC::$CLASSPATH['OC_Calendar_Export'] = 'apps/calendar/lib/export.php';
//General Hooks //General Hooks
OCP\Util::connectHook('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'createUser');
OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser'); OCP\Util::connectHook('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser');
//Repeating Events Hooks //Repeating Events Hooks
OCP\Util::connectHook('OC_Calendar', 'addEvent', 'OC_Calendar_Repeat', 'generate'); OCP\Util::connectHook('OC_Calendar', 'addEvent', 'OC_Calendar_Repeat', 'generate');

@ -11,7 +11,18 @@
*/ */
class OC_Calendar_Hooks{ class OC_Calendar_Hooks{
/** /**
* @brief Deletes all Addressbooks of a certain user * @brief Creates default calendar for a user
* @param paramters parameters from postCreateUser-Hook
* @return array
*/
public static function createUser($parameters) {
OC_Calendar_Calendar::addCalendar($parameters['uid'],'Default calendar');
return true;
}
/**
* @brief Deletes all calendars of a certain user
* @param paramters parameters from postDeleteUser-Hook * @param paramters parameters from postDeleteUser-Hook
* @return array * @return array
*/ */

@ -2,10 +2,10 @@
var defaultView = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>'; var defaultView = '<?php echo OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'currentview', 'month') ?>';
var eventSources = <?php echo json_encode($_['eventSources']) ?>; var eventSources = <?php echo json_encode($_['eventSources']) ?>;
var categories = <?php echo json_encode($_['categories']); ?>; var categories = <?php echo json_encode($_['categories']); ?>;
var dayNames = <?php echo json_encode($l->tA(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'))) ?>; var dayNames = new Array("<?php echo $l -> t("Sunday");?>", "<?php echo $l -> t("Monday");?>", "<?php echo $l -> t("Tuesday");?>", "<?php echo $l -> t("Wednesday");?>", "<?php echo $l -> t("Thursday");?>", "<?php echo $l -> t("Friday");?>", "<?php echo $l -> t("Saturday");?>");
var dayNamesShort = <?php echo json_encode($l->tA(array('Sun.', 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.', 'Sat.'))) ?>; var dayNamesShort = new Array("<?php echo $l -> t("Sun.");?>", "<?php echo $l -> t("Mon.");?>", "<?php echo $l -> t("Tue.");?>", "<?php echo $l -> t("Wed.");?>", "<?php echo $l -> t("Thu.");?>", "<?php echo $l -> t("Fri.");?>", "<?php echo $l -> t("Sat.");?>");
var monthNames = <?php echo json_encode($l->tA(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'))) ?>; var monthNames = new Array("<?php echo $l -> t("January");?>", "<?php echo $l -> t("February");?>", "<?php echo $l -> t("March");?>", "<?php echo $l -> t("April");?>", "<?php echo $l -> t("May");?>", "<?php echo $l -> t("June");?>", "<?php echo $l -> t("July");?>", "<?php echo $l -> t("August");?>", "<?php echo $l -> t("September");?>", "<?php echo $l -> t("October");?>", "<?php echo $l -> t("November");?>", "<?php echo $l -> t("December");?>");
var monthNamesShort = <?php echo json_encode($l->tA(array('Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct.', 'Nov.', 'Dec.'))) ?>; var monthNamesShort = new Array("<?php echo $l -> t("Jan.");?>", "<?php echo $l -> t("Feb.");?>", "<?php echo $l -> t("Mar.");?>", "<?php echo $l -> t("Apr.");?>", "<?php echo $l -> t("May.");?>", "<?php echo $l -> t("Jun.");?>", "<?php echo $l -> t("Jul.");?>", "<?php echo $l -> t("Aug.");?>", "<?php echo $l -> t("Sep.");?>", "<?php echo $l -> t("Oct.");?>", "<?php echo $l -> t("Nov.");?>", "<?php echo $l -> t("Dec.");?>");
var agendatime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}'; var agendatime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>{ - <?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>}';
var defaulttime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>'; var defaulttime = '<?php echo ((int) OCP\Config::getUserValue(OCP\USER::getUser(), 'calendar', 'timeformat', '24') == 24 ? 'HH:mm' : 'hh:mm tt'); ?>';
var allDayText = '<?php echo addslashes($l->t('All day')) ?>'; var allDayText = '<?php echo addslashes($l->t('All day')) ?>';

@ -9,8 +9,9 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
require_once('../loghandler.php'); require_once(__DIR__.'/../loghandler.php');
$categories = isset($_POST['categories'])?$_POST['categories']:null; $categories = isset($_POST['categories'])?$_POST['categories']:null;

@ -9,6 +9,7 @@
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
OC_Contacts_App::scanCategories(); OC_Contacts_App::scanCategories();
$categories = OC_Contacts_App::getCategories(); $categories = OC_Contacts_App::getCategories();

@ -30,6 +30,7 @@ $id = isset($_GET['id'])?$_GET['id']:null;
if(is_null($id)) { if(is_null($id)) {
bailOut(OC_Contacts_App::$l10n->t('Missing ID')); bailOut(OC_Contacts_App::$l10n->t('Missing ID'));
} }
$card = OC_Contacts_VCard::find($id);
$vcard = OC_Contacts_App::getContactVCard( $id ); $vcard = OC_Contacts_App::getContactVCard( $id );
if(is_null($vcard)) { if(is_null($vcard)) {
bailOut(OC_Contacts_App::$l10n->t('Error parsing VCard for ID: "'.$id.'"')); bailOut(OC_Contacts_App::$l10n->t('Error parsing VCard for ID: "'.$id.'"'));
@ -50,5 +51,7 @@ if(isset($details['PHOTO'])) {
$details['PHOTO'] = false; $details['PHOTO'] = false;
} }
$details['id'] = $id; $details['id'] = $id;
$details['displayname'] = $card['fullname'];
$details['addressbookid'] = $card['addressbookid'];
OC_Contacts_App::setLastModifiedHeader($vcard); OC_Contacts_App::setLastModifiedHeader($vcard);
OCP\JSON::success(array('data' => $details)); OCP\JSON::success(array('data' => $details));

@ -66,8 +66,7 @@ if($element != $name) {
switch($element) { switch($element) {
case 'BDAY': case 'BDAY':
$date = New DateTime($value); $date = New DateTime($value);
//$vcard->setDateTime('BDAY', $date, Sabre_VObject_Element_DateTime::DATE); $value = $date->format('Y-m-d');
$value = $date->format(DateTime::ATOM);
break; break;
case 'FN': case 'FN':
if(!$value) { if(!$value) {
@ -89,6 +88,14 @@ if(!$value) {
} else { } else {
/* setting value */ /* setting value */
switch($element) { switch($element) {
case 'BDAY':
// I don't use setDateTime() because that formats it as YYYYMMDD instead of YYYY-MM-DD
// which is what the RFC recommends.
$vcard->children[$line]->setValue($value);
$vcard->children[$line]->parameters = array();
$vcard->children[$line]->add(new Sabre_VObject_Parameter('VALUE', 'DATE'));
debug('Setting value:'.$name.' '.$vcard->children[$line]);
break;
case 'CATEGORIES': case 'CATEGORIES':
debug('Setting string:'.$name.' '.$value); debug('Setting string:'.$name.' '.$value);
$vcard->children[$line]->setValue($value); $vcard->children[$line]->setValue($value);

@ -1,7 +1,7 @@
<?php <?php
$installedVersion=OCP\Config::getAppValue('contacts', 'installed_version'); $installedVersion=OCP\Config::getAppValue('contacts', 'installed_version');
if (version_compare($installedVersion, '0.2.90', '<')) { if (version_compare($installedVersion, '0.2.3', '<')) {
// First set all address books in-active. // First set all address books in-active.
$stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_addressbooks SET active=0' ); $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_addressbooks SET active=0' );
$result = $stmt->execute(array()); $result = $stmt->execute(array());

@ -5,7 +5,7 @@
#leftcontent a { padding: 0 0 0 25px; } #leftcontent a { padding: 0 0 0 25px; }
#rightcontent { top: 3.5em !important; padding-top: 5px; } #rightcontent { top: 3.5em !important; padding-top: 5px; }
#leftcontent h3 { cursor: pointer; -moz-transition: background 300ms ease 0s; background: none no-repeat scroll 1em center #eee; border-bottom: 1px solid #ddd; border-top: 1px solid #fff; display: block; max-width: 100%; padding: 0.5em 0.8em; color: #666; text-shadow: 0 1px 0 #f8f8f8; font-size: 1.2em; } #leftcontent h3 { cursor: pointer; -moz-transition: background 300ms ease 0s; background: none no-repeat scroll 1em center #eee; border-bottom: 1px solid #ddd; border-top: 1px solid #fff; display: block; max-width: 100%; padding: 0.5em 0.8em; color: #666; text-shadow: 0 1px 0 #f8f8f8; font-size: 1.2em; }
#leftcontent h3:hover,#leftcontent h3:active,#leftcontent h3.active { background-color: #DBDBDB; border-bottom: 1px solid #CCCCCC; border-top: 1px solid #D4D4D4; color: #333333; } #leftcontent h3:hover,#leftcontent h3:active,#leftcontent h3.active { background-color: #DBDBDB; border-bottom: 1px solid #CCCCCC; border-top: 1px solid #D4D4D4; color: #333333; font-weight: bold; }
#contacts { position: fixed; background: #fff; max-width: 100%; width: 20em; left: 12.5em; top: 3.7em; bottom: 3em; overflow: auto; padding: 0; margin: 0; } #contacts { position: fixed; background: #fff; max-width: 100%; width: 20em; left: 12.5em; top: 3.7em; bottom: 3em; overflow: auto; padding: 0; margin: 0; }
.contacts a { height: 23px; display: block; left: 12.5em; margin: 0 0 0 0; padding: 0 0 0 25px; } .contacts a { height: 23px; display: block; left: 12.5em; margin: 0 0 0 0; padding: 0 0 0 25px; }
.contacts li.ui-draggable { height: 23px; } .contacts li.ui-draggable { height: 23px; }

@ -80,6 +80,11 @@ $imported = 0;
$failed = 0; $failed = 0;
if(!count($parts) > 0) { if(!count($parts) > 0) {
OCP\JSON::error(array('data' => array('message' => 'No contacts to import in '.$_POST['file'].'. Please check if the file is corrupted.', 'file'=>$_POST['file']))); OCP\JSON::error(array('data' => array('message' => 'No contacts to import in '.$_POST['file'].'. Please check if the file is corrupted.', 'file'=>$_POST['file'])));
if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
if(!$view->unlink('/imports/' . $_POST['file'])) {
OCP\Util::writeLog('contacts','Import: Error unlinking OC_FilesystemView ' . '/' . $_POST['file'], OCP\Util::ERROR);
}
}
exit(); exit();
} }
foreach($parts as $part){ foreach($parts as $part){

@ -285,7 +285,7 @@ Contacts={
data:undefined, data:undefined,
update:function(params) { // params {cid:int, aid:int} update:function(params) { // params {cid:int, aid:int}
if(!params) { params = {}; } if(!params) { params = {}; }
$('#contacts li').removeClass('active'); $('#contacts li,#contacts h3').removeClass('active');
console.log('Card, cid: ' + params.cid + ' aid: ' + params.aid); console.log('Card, cid: ' + params.cid + ' aid: ' + params.aid);
var newid, bookid, firstitem; var newid, bookid, firstitem;
if(!parseInt(params.cid) && !parseInt(params.aid)) { if(!parseInt(params.cid) && !parseInt(params.aid)) {
@ -299,7 +299,13 @@ Contacts={
newid = parseInt($('#contacts').find('li[data-bookid="'+bookid+'"]').first().data('id')); newid = parseInt($('#contacts').find('li[data-bookid="'+bookid+'"]').first().data('id'));
} else if(parseInt(params.cid) && !parseInt(params.aid)) { } else if(parseInt(params.cid) && !parseInt(params.aid)) {
newid = parseInt(params.cid); newid = parseInt(params.cid);
var listitem = $('#contacts li[data-id="'+newid+'"]');
console.log('Is contact in list? ' + listitem.length);
if(listitem.length) {
bookid = parseInt($('#contacts li[data-id="'+newid+'"]').data('bookid')); bookid = parseInt($('#contacts li[data-id="'+newid+'"]').data('bookid'));
} else { // contact isn't in list yet.
bookid = 'unknown';
}
} else { } else {
newid = parseInt(params.cid); newid = parseInt(params.cid);
bookid = parseInt(params.aid); bookid = parseInt(params.aid);
@ -311,9 +317,14 @@ Contacts={
console.log('newid: ' + newid + ' bookid: ' +bookid); console.log('newid: ' + newid + ' bookid: ' +bookid);
var localLoadContact = function(newid, bookid) { var localLoadContact = function(newid, bookid) {
if($('.contacts li').length > 0) { if($('.contacts li').length > 0) {
$('#contacts li[data-id="'+newid+'"]').addClass('active');
$.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){ $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':newid},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
if(bookid == 'unknown') {
bookid = jsondata.data.addressbookid;
var entry = Contacts.UI.Card.createEntry(jsondata.data);
$('#contacts ul[data-id="'+bookid+'"]').append(entry);
}
$('#contacts li[data-id="'+newid+'"],#contacts h3[data-id="'+bookid+'"]').addClass('active');
$('#contacts ul[data-id="'+bookid+'"]').slideDown(300); $('#contacts ul[data-id="'+bookid+'"]').slideDown(300);
Contacts.UI.Card.loadContact(jsondata.data, bookid); Contacts.UI.Card.loadContact(jsondata.data, bookid);
} else { } else {
@ -1334,8 +1345,6 @@ Contacts={
}, },
}, },
Addressbooks:{ Addressbooks:{
droptarget:undefined,
droptext:t('contacts', 'Drop a VCF file<br />to import contacts.'),
overview:function(){ overview:function(){
if($('#chooseaddressbook_dialog').dialog('isOpen') == true){ if($('#chooseaddressbook_dialog').dialog('isOpen') == true){
$('#chooseaddressbook_dialog').dialog('moveToTop'); $('#chooseaddressbook_dialog').dialog('moveToTop');
@ -1456,12 +1465,18 @@ Contacts={
batchnum:50, batchnum:50,
drop:function(event, ui) { drop:function(event, ui) {
var dragitem = ui.draggable, droptarget = $(this); var dragitem = ui.draggable, droptarget = $(this);
//console.log('Drop ' + dragitem.data('id') +' on: ' + droptarget.data('id')); if(dragitem.is('li')) {
Contacts.UI.Contacts.dropContact(event, dragitem, droptarget);
} else {
Contacts.UI.Contacts.dropAddressbook(event, dragitem, droptarget);
}
},
dropContact:function(event, dragitem, droptarget) {
if(dragitem.data('bookid') == droptarget.data('id')) { if(dragitem.data('bookid') == droptarget.data('id')) {
return false; return false;
} }
var droplist = (droptarget.is('ul'))?droptarget:droptarget.next(); var droplist = (droptarget.is('ul'))?droptarget:droptarget.next();
$.post(OC.filePath('contacts', 'ajax', 'movetoaddressbook.php'), { ids: dragitem.data('id'), aid: $(this).data('id') }, $.post(OC.filePath('contacts', 'ajax', 'movetoaddressbook.php'), { ids: dragitem.data('id'), aid: droptarget.data('id') },
function(jsondata){ function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
// Do some inserting/removing/sorting magic // Do some inserting/removing/sorting magic
@ -1485,6 +1500,9 @@ Contacts={
} }
}); });
}, },
dropAddressbook:function(event, dragitem, droptarget) {
alert('Dropping address books not implemented yet');
},
// Reload the contacts list. // Reload the contacts list.
update:function(params){ update:function(params){
if(!params) { params = {}; } if(!params) { params = {}; }
@ -1534,7 +1552,7 @@ Contacts={
$('#contacts ul[data-id="'+b+'"]').slideToggle(300); $('#contacts ul[data-id="'+b+'"]').slideToggle(300);
return false; return false;
}); });
var accept = 'li:not([data-bookid="'+b+'"])'; var accept = 'li:not([data-bookid="'+b+'"]),h3:not([data-id="'+b+'"])';
$('#contacts h3[data-id="'+b+'"],#contacts ul[data-id="'+b+'"]').droppable({ $('#contacts h3[data-id="'+b+'"],#contacts ul[data-id="'+b+'"]').droppable({
drop: Contacts.UI.Contacts.drop, drop: Contacts.UI.Contacts.drop,
activeClass: 'ui-state-hover', activeClass: 'ui-state-hover',
@ -1542,9 +1560,10 @@ Contacts={
}); });
} }
var contactlist = $('#contacts ul[data-id="'+b+'"]'); var contactlist = $('#contacts ul[data-id="'+b+'"]');
var contacts = $('#contacts ul[data-id="'+b+'"] li');
for(var c in book.contacts) { for(var c in book.contacts) {
if(book.contacts[c].id == undefined) { continue; } if(book.contacts[c].id == undefined) { continue; }
if($('#contacts li[data-id="'+book.contacts[c]['id']+'"][data-id="'+book.contacts[c]['bookid']+'"]').length == 0) { if(!$('#contacts li[data-id="'+book.contacts[c]['id']+'"]').length) {
var contact = Contacts.UI.Card.createEntry(book.contacts[c]); var contact = Contacts.UI.Card.createEntry(book.contacts[c]);
if(c == self.batchnum-5) { if(c == self.batchnum-5) {
contact.bind('inview', function(event, isInView, visiblePartX, visiblePartY) { contact.bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
@ -1557,12 +1576,22 @@ Contacts={
} }
}); });
} }
var added = false;
contacts.each(function(){
if ($(this).text().toLowerCase() > book.contacts[c].displayname.toLowerCase()) {
$(this).before(contact);
added = true;
return false;
}
});
if(!added) {
contactlist.append(contact); contactlist.append(contact);
} }
} }
}
}); });
if($('#contacts h3').length > 1) { if($('#contacts h3').length > 1) {
$('#contacts li').draggable({ $('#contacts li,#contacts h3').draggable({
revert: 'invalid', revert: 'invalid',
axis: 'y', containment: '#contacts', axis: 'y', containment: '#contacts',
scroll: true, scrollSensitivity: 100, scroll: true, scrollSensitivity: 100,
@ -1625,7 +1654,13 @@ $(document).ready(function(){
item.addClass('active'); item.addClass('active');
var oldid = $('#rightcontent').data('id'); var oldid = $('#rightcontent').data('id');
if(oldid != 0){ if(oldid != 0){
$('.contacts li[data-id="'+oldid+'"]').removeClass('active'); var olditem = $('.contacts li[data-id="'+oldid+'"]');
var oldbookid = olditem.data('bookid');
olditem.removeClass('active');
if(oldbookid != bookid) {
$('#contacts h3[data-id="'+oldbookid+'"]').removeClass('active');
$('#contacts h3[data-id="'+bookid+'"]').addClass('active');
}
} }
$.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){ $.getJSON(OC.filePath('contacts', 'ajax', 'contactdetails.php'),{'id':id},function(jsondata){
if(jsondata.status == 'success'){ if(jsondata.status == 'success'){
@ -1643,6 +1678,7 @@ $(document).ready(function(){
Contacts.UI.Card.saveProperty(this); Contacts.UI.Card.saveProperty(this);
}); });
$(function() {
// Upload function for dropped contact photos files. Should go in the Contacts class/object. // Upload function for dropped contact photos files. Should go in the Contacts class/object.
$.fileUpload = function(files){ $.fileUpload = function(files){
var file = files[0]; var file = files[0];
@ -1690,6 +1726,7 @@ $(document).ready(function(){
xhr.setRequestHeader('Content-Type', file.type); xhr.setRequestHeader('Content-Type', file.type);
xhr.send(file); xhr.send(file);
} }
});
$(document).bind('drop dragover', function (e) { $(document).bind('drop dragover', function (e) {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone

@ -34,12 +34,12 @@
*/ */
class OC_Contacts_Hooks{ class OC_Contacts_Hooks{
/** /**
* @brief Add default Addressbooks of a certain user * @brief Add default Addressbook for a certain user
* @param paramters parameters from postDeleteUser-Hook * @param paramters parameters from postCreateUser-Hook
* @return array * @return array
*/ */
static public function createUser($parameters) { static public function createUser($parameters) {
OC_Contacts_Addressbook::addDefault($parameters['uid'],'default','Default Address Book'); OC_Contacts_Addressbook::addDefault($parameters['uid']);
return true; return true;
} }

@ -430,7 +430,6 @@ class OC_Contacts_VCard{
* @return boolean * @return boolean
*/ */
public static function delete($id){ public static function delete($id){
// FIXME: Add error checking.
OC_Hook::emit('OC_Contacts_VCard', 'pre_deleteVCard', array('aid' => null, 'id' => $id, 'uri' => null)); OC_Hook::emit('OC_Contacts_VCard', 'pre_deleteVCard', array('aid' => null, 'id' => $id, 'uri' => null));
$stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' ); $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' );
try { try {
@ -451,7 +450,6 @@ class OC_Contacts_VCard{
* @return boolean * @return boolean
*/ */
public static function deleteFromDAVData($aid,$uri){ public static function deleteFromDAVData($aid,$uri){
// FIXME: Add error checking. Deleting a card gives an Kontact/Akonadi error.
OC_Hook::emit('OC_Contacts_VCard', 'pre_deleteVCard', array('aid' => $aid, 'id' => null, 'uri' => $uri)); OC_Hook::emit('OC_Contacts_VCard', 'pre_deleteVCard', array('aid' => $aid, 'id' => null, 'uri' => $uri));
$stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' ); $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' );
try { try {

@ -3,7 +3,7 @@
<name>*dbname*</name> <name>*dbname*</name>
<create>true</create> <create>true</create>
<overwrite>false</overwrite> <overwrite>false</overwrite>
<charset>latin1</charset> <charset>utf8</charset>
<table> <table>
<name>*dbprefix*sharing_log</name> <name>*dbprefix*sharing_log</name>
<declaration> <declaration>

@ -27,6 +27,7 @@
// Check user and app status // Check user and app status
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\App::checkAppEnabled('files_versions'); OCP\App::checkAppEnabled('files_versions');
OCP\JSON::callCheck();
$versions = new OCA_Versions\Storage(); $versions = new OCA_Versions\Storage();

@ -1,6 +1,7 @@
<?php <?php
OCP\JSON::checkAppEnabled('files_versions'); OCP\JSON::checkAppEnabled('files_versions');
OCP\JSON::callCheck();
$userDirectory = "/".OCP\USER::getUser()."/files"; $userDirectory = "/".OCP\USER::getUser()."/files";

@ -2,6 +2,7 @@
OCP\JSON::checkAppEnabled('files_versions'); OCP\JSON::checkAppEnabled('files_versions');
OCP\JSON::checkAdminUser(); OCP\JSON::checkAdminUser();
OCP\JSON::callCheck();
if (OCP\Config::getSystemValue('versions', 'true')=='true') { if (OCP\Config::getSystemValue('versions', 'true')=='true') {
OCP\Config::setSystemValue('versions', 'false'); OCP\Config::setSystemValue('versions', 'false');
} else { } else {

@ -7,4 +7,7 @@
<author>Michiel de Jong</author> <author>Michiel de Jong</author>
<require>4</require> <require>4</require>
<shipped>true</shipped> <shipped>true</shipped>
<remote>
<remoteStorage>webdav.php</remoteStorage>
</remote>
</info> </info>

@ -1,8 +1,8 @@
<?php if(OC_User::userExists(WF_USER)) { ?> <?php if(OC_User::userExists(WF_USER)): ?>
{ {
"rel":"remoteStorage", "rel":"remoteStorage",
"template":"<?php echo WF_BASEURL; ?>/apps/remoteStorage/WebDAV.php/<?php echo WF_USER; ?>/remoteStorage/{category}/", "template":"<?php echo WF_BASEURL; ?>/remote.php/remoteStorage/<?php echo WF_USER; ?>/remoteStorage/{category}/",
"api":"WebDAV", "api":"WebDAV",
"auth":"<?php echo WF_BASEURL; ?>/?app=remoteStorage&getfile=auth.php&userid=<?php echo WF_USER; ?>" "auth":"<?php echo WF_BASEURL; ?>/?app=remoteStorage&getfile=auth.php&userid=<?php echo WF_USER; ?>"
} }
<?php } ?> <?php endif ?>

@ -25,22 +25,7 @@
* *
*/ */
OC_App::loadApps(array('filesystem','authentication'));
// Do not load FS ...
$RUNTIME_NOSETUPFS = true;
require_once('../../lib/base.php');
require_once('../../lib/user.php');
require_once('../../lib/public/user.php');
require_once('../../lib/app.php');
require_once('../../lib/public/app.php');
require_once('../../3rdparty/Sabre/DAV/Auth/IBackend.php');
require_once('../../3rdparty/Sabre/DAV/Auth/Backend/AbstractBasic.php');
require_once('../../lib/connector/sabre/auth.php');
OCP\App::checkAppEnabled('remoteStorage'); OCP\App::checkAppEnabled('remoteStorage');
require_once('lib_remoteStorage.php'); require_once('lib_remoteStorage.php');
@ -61,14 +46,15 @@ if(isset($_SERVER['HTTP_ORIGIN'])) {
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');
} }
$path = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["SCRIPT_NAME"])); $path = substr($_SERVER["REQUEST_URI"], strlen($baseuri));
$pathParts = explode('/', $path); $pathParts = explode('/', $path);
// for webdav: // for webdav:
// 0/ 1 / 2 / 3... // 0 / 1 / 2...
// /$ownCloudUser/remoteStorage/$category/ // $ownCloudUser/remoteStorage/$category/
if(count($pathParts) >= 3 && $pathParts[0] == '') { if(count($pathParts) >= 2) {
list($dummy, $ownCloudUser, $dummy2, $category) = $pathParts; list($ownCloudUser, $dummy2, $category) = $pathParts;
OC_Util::setupFS($ownCloudUser); OC_Util::setupFS($ownCloudUser);
@ -77,7 +63,7 @@ if(count($pathParts) >= 3 && $pathParts[0] == '') {
$server = new Sabre_DAV_Server($publicDir); $server = new Sabre_DAV_Server($publicDir);
// Path to our script // Path to our script
$server->setBaseUri(OC::$WEBROOT."/apps/remoteStorage/WebDAV.php/$ownCloudUser"); $server->setBaseUri($baseuri.$ownCloudUser);
// Auth backend // Auth backend
$authBackend = new OC_Connector_Sabre_Auth_ro_oauth( $authBackend = new OC_Connector_Sabre_Auth_ro_oauth(

@ -3,6 +3,7 @@
// Init owncloud // Init owncloud
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks'); OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true); $calendars = OC_Calendar_Calendar::allCalendars(OCP\User::getUser(), true);
$first_calendar = reset($calendars); $first_calendar = reset($calendars);

@ -23,6 +23,7 @@
// Init owncloud // Init owncloud
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks'); OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];
$task = OC_Calendar_App::getEventObject( $id ); $task = OC_Calendar_App::getEventObject( $id );

@ -3,6 +3,7 @@
// Init owncloud // Init owncloud
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks'); OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$l10n = new OC_L10N('tasks'); $l10n = new OC_L10N('tasks');

@ -9,6 +9,7 @@
// Init owncloud // Init owncloud
OCP\JSON::checkLoggedIn(); OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks'); OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$id = $_POST['id']; $id = $_POST['id'];
$property = $_POST['type']; $property = $_POST['type'];

@ -0,0 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^host-meta host-meta.php [QSA,L]
</IfModule>

@ -1,10 +1,27 @@
<?php <?php
if(class_exists('OC')){
$WEBROOT=OC::$WEBROOT;
}else{//not called trough remote.php try to guess the webroot the best we can from here
// calculate the root directories
$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-strlen('apps/user_webfinger/host-meta.php')));
$WEBROOT=substr($SERVERROOT,strlen(realpath($_SERVER['DOCUMENT_ROOT'])));
if($WEBROOT!='' and $WEBROOT[0]!=='/'){
$WEBROOT='/'.$WEBROOT;
}
}
if(substr($WEBROOT,-1)==='/'){
$WEBROOT=substr($WEBROOT,0,-1);
}
$hostMetaHeader = array( $hostMetaHeader = array(
'Access-Control-Allow-Origin' => '*', 'Access-Control-Allow-Origin' => '*',
'Content-Type' => 'application/xrd+json' 'Content-Type' => 'application/xrd+json'
); );
$serverName = $_SERVER['SERVER_NAME']; $serverName = $_SERVER['SERVER_NAME'];
$hostMetaContents = '{"links":[{"rel":"lrdd","template":"http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$serverName.'/public.php?service=webfinger&q={uri}"}]}'; $hostMetaContents = '{"links":[{"rel":"lrdd","template":"http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$serverName.$WEBROOT.'/public.php?service=webfinger&q={uri}"}]}';
foreach($hostMetaHeader as $header => $value) { foreach($hostMetaHeader as $header => $value) {
header($header . ": " . $value); header($header . ": " . $value);
} }

@ -1,53 +1,36 @@
#!/bin/bash
# #
# sqlite testing now # ownCloud
# #
echo "Setup environment for sqlite testing ..." # @author Thomas Müller
# @copyright 2012 Thomas Müller thomas.mueller@tmit.eu
#
DATADIR=data-autotest DATADIR=data-autotest
rm -rf $DATADIR BASEDIR=$PWD
mkdir $DATADIR
rm -rf config/config.php # create autoconfig for sqlite, mysql and (soon) postgresql
#cp autotest/config.sqlite.php config/autoconfig.php cat > ./tests/autoconfig-sqlite.php <<DELIM
cat > ./config/autoconfig.php <<DELIM
<?php <?php
\$AUTOCONFIG = array ( \$AUTOCONFIG = array (
'installed' => false, 'installed' => false,
'dbtype' => 'sqlite', 'dbtype' => 'sqlite',
'dbtableprefix' => 'oc_', 'dbtableprefix' => 'oc_',
'datadirectory' => 'data',
'adminlogin' => 'admin', 'adminlogin' => 'admin',
'adminpass' => 'admin', 'adminpass' => 'admin',
'directory' => '$PWD/$DATADIR', 'directory' => '$BASEDIR/$DATADIR',
); );
DELIM DELIM
php -f index.php cat > ./tests/autoconfig-mysql.php <<DELIM
#test execution
echo 'Testing with sqlite ...'
cd tests
php -f index.php -- xml > autotest-results-sqlite.xml
#
# mysql testing now
#
# NOTES:
# - grant access permissions: grant all on oc_autotest.* to 'oc_autotest'@'localhost';
#
echo "Setup environment for MySql testing ..."
DATADIR=data-autotest
rm -rf $DATADIR
mkdir $DATADIR
rm -rf config/config.php
cat > ./config/autoconfig.php <<DELIM
<?php <?php
\$AUTOCONFIG = array ( \$AUTOCONFIG = array (
'installed' => false, 'installed' => false,
'dbtype' => 'mysql', 'dbtype' => 'mysql',
'dbtableprefix' => 'oc_', 'dbtableprefix' => 'oc_',
'datadirectory' => 'data',
'adminlogin' => 'admin', 'adminlogin' => 'admin',
'adminpass' => 'admin', 'adminpass' => 'admin',
'directory' => '$PWD/$DATADIR', 'directory' => '$BASEDIR/$DATADIR',
'dbuser' => 'oc_autotest', 'dbuser' => 'oc_autotest',
'dbname' => 'oc_autotest', 'dbname' => 'oc_autotest',
'dbhost' => 'localhost', 'dbhost' => 'localhost',
@ -55,18 +38,52 @@ cat > ./config/autoconfig.php <<DELIM
); );
DELIM DELIM
#drop the database
mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest"
#setup function execute_tests {
php -f index.php echo "Setup environment for $1 testing ..."
# back to root folder
cd $BASEDIR
echo $BASEDIR
# revert changes to tests/data
git checkout tests/data/*
#test execution # reset data directory
echo 'Testing with MySql ...' rm -rf $DATADIR
cd tests mkdir $DATADIR
php -f index.php -- xml > autotest-results-MySql.xml
# remove the old config file
rm -rf config/config.php
# drop database
if [ "$1" == "mysql" ] ; then
mysql -u oc_autotest -powncloud -e "DROP DATABASE oc_autotest"
fi
# copy autoconfig
cp $BASEDIR/tests/autoconfig-$1.php $BASEDIR/config/autoconfig.php
# trigger installation
php -f index.php
#test execution
echo "Testing with $1 ..."
cd tests
php -f index.php -- xml $1 > autotest-results-$1.xml
}
#
# start test execution
# #
# TODO: create config for postgres execute_tests "sqlite"
execute_tests 'mysql'
# TODO: implement this
#execute_tests 'postgresql'
#
# NOTES:
# - CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY 'owncloud';
# - grant access permissions: grant all on oc_autotest.* to 'oc_autotest'@'localhost';
# #

@ -31,6 +31,10 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
* @return bool * @return bool
*/ */
protected function validateUserPass($username, $password){ protected function validateUserPass($username, $password){
if (OC_User::isLoggedIn()) {
OC_Util::setupFS($username);
return true;
} else {
OC_Util::setUpFS();//login hooks may need early access to the filesystem OC_Util::setUpFS();//login hooks may need early access to the filesystem
if(OC_User::login($username,$password)){ if(OC_User::login($username,$password)){
OC_Util::setUpFS($username); OC_Util::setUpFS($username);
@ -40,4 +44,5 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic {
return false; return false;
} }
} }
}
} }

@ -42,7 +42,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
*/ */
public function get() { public function get() {
return OC_Filesystem::readfile($this->path); return OC_Filesystem::fopen($this->path,'rb');
} }

@ -154,8 +154,15 @@ class OC_L10N{
* *
* Returns the translation. If no translation is found, $textArray will be * Returns the translation. If no translation is found, $textArray will be
* returned. * returned.
*
*
* @deprecated deprecated since ownCloud version 5.0
* This method will probably be removed with ownCloud 6.0
*
*
*/ */
public function tA($textArray){ public function tA($textArray){
OC_Log::write('core', 'DEPRECATED: the method tA is deprecated and will be removed soon.',OC_Log::WARN);
$result = array(); $result = array();
foreach($textArray as $key => $text){ foreach($textArray as $key => $text){
$result[$key] = (string)$this->t($text); $result[$key] = (string)$this->t($text);

@ -200,7 +200,7 @@ class OC_User {
if( $run ){ if( $run ){
$uid=self::checkPassword( $uid, $password ); $uid=self::checkPassword( $uid, $password );
if($uid){ if($uid){
session_regenerate_id(); session_regenerate_id(true);
self::setUserId($uid); self::setUserId($uid);
OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password )); OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>$password ));
return true; return true;

@ -26,8 +26,7 @@ require_once 'simpletest/mock_objects.php';
require_once 'simpletest/collector.php'; require_once 'simpletest/collector.php';
require_once 'simpletest/default_reporter.php'; require_once 'simpletest/default_reporter.php';
// test suite instance $testSuiteName="ownCloud Unit Test Suite";
$testSuite=new TestSuite("ownCloud Unit Test Suite");
// prepare the reporter // prepare the reporter
if(OC::$CLI){ if(OC::$CLI){
@ -37,12 +36,19 @@ if(OC::$CLI){
{ {
$reporter= new XmlReporter; $reporter= new XmlReporter;
$test=false; $test=false;
if(isset($_SERVER['argv'][2])){
$testSuiteName=$testSuiteName." (".$_SERVER['argv'][2].")";
}
} }
}else{ }else{
$reporter='HtmlReporter'; $reporter='HtmlReporter';
$test=isset($_GET['test'])?$_GET['test']:false; $test=isset($_GET['test'])?$_GET['test']:false;
} }
// test suite instance
$testSuite=new TestSuite($testSuiteName);
//load core test cases //load core test cases
loadTests(dirname(__FILE__), $testSuite, $test); loadTests(dirname(__FILE__), $testSuite, $test);

Loading…
Cancel
Save