diff options
Diffstat (limited to 'apps/contacts')
-rw-r--r-- | apps/contacts/ajax/activation.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/addcontact.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/addproperty.php | 45 | ||||
-rw-r--r-- | apps/contacts/ajax/createaddressbook.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/cropphoto.php | 2 | ||||
-rw-r--r-- | apps/contacts/ajax/deletebook.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/deletecard.php | 13 | ||||
-rw-r--r-- | apps/contacts/ajax/deleteproperty.php | 5 | ||||
-rw-r--r-- | apps/contacts/ajax/savecrop.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/saveproperty.php | 9 | ||||
-rw-r--r-- | apps/contacts/ajax/uploadphoto.php | 4 | ||||
-rw-r--r-- | apps/contacts/import.php | 2 | ||||
-rw-r--r-- | apps/contacts/js/contacts.js | 24 | ||||
-rw-r--r-- | apps/contacts/js/loader.js | 14 | ||||
-rw-r--r-- | apps/contacts/lib/vcard.php | 5 | ||||
-rw-r--r-- | apps/contacts/templates/part.contact.php | 4 | ||||
-rw-r--r-- | apps/contacts/templates/part.contacts.php | 2 | ||||
-rw-r--r-- | apps/contacts/templates/part.cropphoto.php | 2 | ||||
-rw-r--r-- | apps/contacts/templates/part.importaddressbook.php | 5 |
19 files changed, 94 insertions, 47 deletions
diff --git a/apps/contacts/ajax/activation.php b/apps/contacts/ajax/activation.php index 388a3b5438c..74cb738ab8f 100644 --- a/apps/contacts/ajax/activation.php +++ b/apps/contacts/ajax/activation.php @@ -10,6 +10,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); $bookid = $_POST['bookid']; $book = OC_Contacts_App::getAddressbook($bookid);// is owner access check diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php index af9b2bbcc0e..e45072c9542 100644 --- a/apps/contacts/ajax/addcontact.php +++ b/apps/contacts/ajax/addcontact.php @@ -23,6 +23,7 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); $aid = isset($_POST['aid'])?$_POST['aid']:null; if(!$aid) { diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 2f932d752a7..f888b94e386 100644 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -23,6 +23,13 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); + +function bailOut($msg) { + OCP\JSON::error(array('data' => array('message' => $msg))); + OCP\Util::writeLog('contacts','ajax/addproperty.php: '.$msg, OCP\Util::DEBUG); + exit(); +} $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; @@ -31,11 +38,21 @@ $parameters = isset($_POST['parameters'])?$_POST['parameters']:array(); $vcard = OC_Contacts_App::getContactVCard($id); +if(!$name) { + bailOut(OC_Contacts_App::$l10n->t('element name is not set.')); +} +if(!$id) { + bailOut(OC_Contacts_App::$l10n->t('id is not set.')); +} + +if(!$vcard) { + bailOut(OC_Contacts_App::$l10n->t('Could not parse contact: ').$id); +} + if(!is_array($value)){ $value = trim($value); if(!$value && in_array($name, array('TEL', 'EMAIL', 'ORG', 'BDAY', 'URL', 'NICKNAME', 'NOTE'))) { - OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Cannot add empty property.')))); - exit(); + bailOut(OC_Contacts_App::$l10n->t('Cannot add empty property.')); } } elseif($name === 'ADR') { // only add if non-empty elements. $empty = true; @@ -46,8 +63,7 @@ if(!is_array($value)){ } } if($empty) { - OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')))); - exit(); + bailOut(OC_Contacts_App::$l10n->t('At least one of the address fields has to be filled out.')); } } @@ -56,9 +72,7 @@ $current = $vcard->select($name); foreach($current as $item) { $tmpvalue = (is_array($value)?implode(';', $value):$value); if($tmpvalue == $item->value) { - OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Trying to add duplicate property: ').$name.': '.$tmpvalue))); - OCP\Util::writeLog('contacts','ajax/addproperty.php: Trying to add duplicate property: '.$name.': '.$tmpvalue, OCP\Util::DEBUG); - exit(); + bailOut(OC_Contacts_App::$l10n->t('Trying to add duplicate property: '.$name.': '.$tmpvalue)); } } @@ -69,6 +83,7 @@ if(is_array($value)) { $value = strip_tags($value); } +/* preprocessing value */ switch($name) { case 'BDAY': $date = New DateTime($value); @@ -81,6 +96,8 @@ switch($name) { case 'N': case 'ORG': case 'NOTE': + $value = str_replace('\n', ' \\n', $value); + break; case 'NICKNAME': // TODO: Escape commas and semicolons. break; @@ -92,8 +109,14 @@ switch($name) { break; } - -$property = $vcard->addProperty($name, $value); //, $parameters); +switch($name) { + case 'NOTE': + $vcard->setString('NOTE', $value); + break; + default: + $property = $vcard->addProperty($name, $value); //, $parameters); + break; +} $line = count($vcard->children) - 1; @@ -114,9 +137,7 @@ foreach ($parameters as $key=>$element) { $checksum = md5($vcard->children[$line]->serialize()); if(!OC_Contacts_VCard::edit($id,$vcard)) { - OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error adding contact property.')))); - OCP\Util::writeLog('contacts','ajax/addproperty.php: Error updating contact property: '.$name, OCP\Util::ERROR); - exit(); + bailOut(OC_Contacts_App::$l10n->t('Error adding contact property: '.$name)); } OCP\JSON::success(array('data' => array( 'checksum' => $checksum ))); diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php index af7c19eef51..616766bb1a0 100644 --- a/apps/contacts/ajax/createaddressbook.php +++ b/apps/contacts/ajax/createaddressbook.php @@ -11,6 +11,7 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); $userid = OCP\USER::getUser(); $name = trim(strip_tags($_POST['name'])); diff --git a/apps/contacts/ajax/cropphoto.php b/apps/contacts/ajax/cropphoto.php index caba7c8c4ef..eb9f1fcdb5d 100644 --- a/apps/contacts/ajax/cropphoto.php +++ b/apps/contacts/ajax/cropphoto.php @@ -25,10 +25,12 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); $tmpkey = $_GET['tmpkey']; +$requesttoken = $_GET['requesttoken']; $id = $_GET['id']; $tmpl = new OCP\Template("contacts", "part.cropphoto"); $tmpl->assign('tmpkey', $tmpkey); $tmpl->assign('id', $id); +$tmpl->assign('requesttoken', $requesttoken); $page = $tmpl->fetchPage(); OCP\JSON::success(array('data' => array( 'page' => $page ))); diff --git a/apps/contacts/ajax/deletebook.php b/apps/contacts/ajax/deletebook.php index fe582daa00f..1b86ecf223e 100644 --- a/apps/contacts/ajax/deletebook.php +++ b/apps/contacts/ajax/deletebook.php @@ -23,6 +23,7 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); //$id = $_GET['id']; $id = $_POST['id']; diff --git a/apps/contacts/ajax/deletecard.php b/apps/contacts/ajax/deletecard.php index 6414fda93cb..2a6bd277d19 100644 --- a/apps/contacts/ajax/deletecard.php +++ b/apps/contacts/ajax/deletecard.php @@ -28,8 +28,19 @@ function bailOut($msg) { // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); -$id = isset($_GET['id'])?$_GET['id']:null; +// foreach($_SERVER as $key=>$value) { +// OCP\Util::writeLog('contacts','ajax/saveproperty.php: _SERVER: '.$key.'=>'.$value, OCP\Util::DEBUG); +// } +foreach($_POST as $key=>$value) { + OCP\Util::writeLog('contacts','ajax/saveproperty.php: _POST: '.$key.'=>'.print_r($value, true), OCP\Util::DEBUG); +} +foreach($_GET as $key=>$value) { + OCP\Util::writeLog('contacts','ajax/saveproperty.php: _GET: '.$key.'=>'.print_r($value, true), OCP\Util::DEBUG); +} + +$id = isset($_POST['id'])?$_POST['id']:null; if(!$id) { bailOut(OC_Contacts_App::$l10n->t('id is not set.')); } diff --git a/apps/contacts/ajax/deleteproperty.php b/apps/contacts/ajax/deleteproperty.php index b0746d18a79..55f7e323083 100644 --- a/apps/contacts/ajax/deleteproperty.php +++ b/apps/contacts/ajax/deleteproperty.php @@ -23,9 +23,10 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); -$id = $_GET['id']; -$checksum = $_GET['checksum']; +$id = $_POST['id']; +$checksum = $_POST['checksum']; $vcard = OC_Contacts_App::getContactVCard( $id ); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); diff --git a/apps/contacts/ajax/savecrop.php b/apps/contacts/ajax/savecrop.php index b3aab6a8810..6faf6a173d5 100644 --- a/apps/contacts/ajax/savecrop.php +++ b/apps/contacts/ajax/savecrop.php @@ -22,6 +22,7 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); // Firefox and Konqueror tries to download application/json for me. --Arthur OCP\JSON::setContentTypeHeader('text/plain'); diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php index d8400734710..6ee9ec90b56 100644 --- a/apps/contacts/ajax/saveproperty.php +++ b/apps/contacts/ajax/saveproperty.php @@ -20,10 +20,6 @@ * */ -// Check if we are a user -OCP\JSON::checkLoggedIn(); -OCP\JSON::checkAppEnabled('contacts'); - function bailOut($msg) { OCP\JSON::error(array('data' => array('message' => $msg))); OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); @@ -33,6 +29,11 @@ function debug($msg) { OCP\Util::writeLog('contacts','ajax/saveproperty.php: '.$msg, OCP\Util::DEBUG); } +// Check if we are a user +OCP\JSON::checkLoggedIn(); +OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); + $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; $value = isset($_POST['value'])?$_POST['value']:null; diff --git a/apps/contacts/ajax/uploadphoto.php b/apps/contacts/ajax/uploadphoto.php index 09c4e55d4a9..889de6a1f8b 100644 --- a/apps/contacts/ajax/uploadphoto.php +++ b/apps/contacts/ajax/uploadphoto.php @@ -23,6 +23,8 @@ // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); +OCP\JSON::callCheck(); + // Firefox and Konqueror tries to download application/json for me. --Arthur OCP\JSON::setContentTypeHeader('text/plain'); function bailOut($msg) { @@ -59,7 +61,7 @@ if ($fn) { bailOut(OC_Contacts_App::$l10n->t('Couldn\'t save temporary image: ').$tmpkey); } } else { - bailOut(OC_Contacts_App::$l10n->t('Couldn\'t load temporary image: ').$tmpkey.$data); + bailOut(OC_Contacts_App::$l10n->t('Couldn\'t load temporary image: ').$tmpkey); } } diff --git a/apps/contacts/import.php b/apps/contacts/import.php index 0ee35f9fd81..c95fd970fe1 100644 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -15,7 +15,7 @@ session_write_close(); $nl = "\n"; global $progresskey; -$progresskey = 'contacts.import-' . $_GET['progresskey']; +$progresskey = 'contacts.import-' . (isset($_GET['progresskey'])?$_GET['progresskey']:''); if (isset($_GET['progress']) && $_GET['progress']) { echo OC_Cache::get($progresskey); diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js index 35d4a4a216d..a1b9976006d 100644 --- a/apps/contacts/js/contacts.js +++ b/apps/contacts/js/contacts.js @@ -368,7 +368,7 @@ Contacts={ $('#contacts_deletecard').tipsy('hide'); OC.dialogs.confirm(t('contacts', 'Are you sure you want to delete this contact?'), t('contacts', 'Warning'), function(answer) { if(answer == true) { - $.getJSON(OC.filePath('contacts', 'ajax', 'deletecard.php'),{'id':Contacts.UI.Card.id},function(jsondata){ + $.post(OC.filePath('contacts', 'ajax', 'deletecard.php'),{'id':Contacts.UI.Card.id},function(jsondata){ if(jsondata.status == 'success'){ var newid = ''; var curlistitem = $('#leftcontent [data-id="'+jsondata.data.id+'"]'); @@ -622,7 +622,7 @@ Contacts={ q = q + '&id=' + this.id + '&name=' + name; if(checksum != undefined && checksum != '') { // save q = q + '&checksum=' + checksum; - //console.log('Saving: ' + q); + console.log('Saving: ' + q); $(obj).attr('disabled', 'disabled'); $.post(OC.filePath('contacts', 'ajax', 'saveproperty.php'),q,function(jsondata){ if(jsondata.status == 'success'){ @@ -640,7 +640,7 @@ Contacts={ } },'json'); } else { // add - //console.log('Adding: ' + q); + console.log('Adding: ' + q); $(obj).attr('disabled', 'disabled'); $.post(OC.filePath('contacts', 'ajax', 'addproperty.php'),q,function(jsondata){ if(jsondata.status == 'success'){ @@ -707,7 +707,7 @@ Contacts={ Contacts.UI.loading(obj, true); var checksum = Contacts.UI.checksumFor(obj); if(checksum) { - $.getJSON(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){ + $.post(OC.filePath('contacts', 'ajax', 'deleteproperty.php'),{'id': this.id, 'checksum': checksum },function(jsondata){ if(jsondata.status == 'success'){ if(type == 'list') { Contacts.UI.propertyContainerFor(obj).remove(); @@ -839,22 +839,22 @@ Contacts={ $('#addressdisplay dl').last().data('checksum', this.data.ADR[adr]['checksum']); var adrarray = this.data.ADR[adr]['value']; var adrtxt = ''; - if(adrarray[0].length > 0) { + if(adrarray[0] && adrarray[0].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[0].strip_tags() + '</li>'; } - if(adrarray[1].length > 0) { + if(adrarray[1] && adrarray[1].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[1].strip_tags() + '</li>'; } - if(adrarray[2].length > 0) { + if(adrarray[2] && adrarray[2].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[2].strip_tags() + '</li>'; } - if(adrarray[3].length > 0 || adrarray[5].length > 0) { + if((adrarray[3] && adrarray[5]) && adrarray[3].length > 0 || adrarray[5].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[5].strip_tags() + ' ' + adrarray[3].strip_tags() + '</li>'; } - if(adrarray[4].length > 0) { + if(adrarray[4] && adrarray[4].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[4].strip_tags() + '</li>'; } - if(adrarray[6].length > 0) { + if(adrarray[6] && adrarray[6].length > 0) { adrtxt = adrtxt + '<li>' + adrarray[6].strip_tags() + '</li>'; } $('#addressdisplay dl').last().find('.addresslist').html(adrtxt); @@ -1152,7 +1152,7 @@ Contacts={ }, editPhoto:function(id, tmpkey){ //alert('editPhoto: ' + tmpkey); - $.getJSON(OC.filePath('contacts', 'ajax', 'cropphoto.php'),{'tmpkey':tmpkey,'id':this.id},function(jsondata){ + $.getJSON(OC.filePath('contacts', 'ajax', 'cropphoto.php'),{'tmpkey':tmpkey,'id':this.id, 'requesttoken':requesttoken},function(jsondata){ if(jsondata.status == 'success'){ //alert(jsondata.data.page); $('#edit_photo_dialog_img').html(jsondata.data.page); @@ -1645,7 +1645,7 @@ $(document).ready(function(){ //} } }; - xhr.open('POST', OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&imagefile='+encodeURIComponent(file.name), true); + xhr.open('POST', OC.filePath('contacts', 'ajax', 'uploadphoto.php')+'?id='+Contacts.UI.Card.id+'&requesttoken='+requesttoken+'&imagefile='+encodeURIComponent(file.name), true); xhr.setRequestHeader('Cache-Control', 'no-cache'); xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); xhr.setRequestHeader('X_FILE_NAME', encodeURIComponent(file.name)); diff --git a/apps/contacts/js/loader.js b/apps/contacts/js/loader.js index 961e0f425c9..577ad103064 100644 --- a/apps/contacts/js/loader.js +++ b/apps/contacts/js/loader.js @@ -42,20 +42,20 @@ Contacts_Import={ }
$('#newaddressbook').attr('readonly', 'readonly');
$('#contacts').attr('disabled', 'disabled');
- var progresskey = $('#progresskey').val(); - $.post(OC.filePath('contacts', '', 'import.php') + '?progresskey='+progresskey, {method: String (method), addressbookname: String (addressbookname), path: String (path), file: String (filename), id: String (addressbookid)}, function(jsondata){ + var progresskey = $('#progresskey').val();
+ $.post(OC.filePath('contacts', '', 'import.php') + '?progresskey='+progresskey, {method: String (method), addressbookname: String (addressbookname), path: String (path), file: String (filename), id: String (addressbookid)}, function(jsondata){
if(jsondata.status == 'success'){
$('#progressbar').progressbar('option', 'value', 100);
$('#import_done').find('p').html(t('contacts', 'Result: ') + jsondata.data.imported + t('contacts', ' imported, ') + jsondata.data.failed + t('contacts', ' failed.'));
} else {
- $('#import_done').find('p').html(jsondata.data.message);
+ $('#import_done').find('p').html(jsondata.message);
}
$('#import_done').show().find('p').addClass('bold');
$('#progressbar').fadeOut('slow');
});
$('#form_container').css('display', 'none');
$('#progressbar_container').css('display', 'block');
- window.setTimeout('Contacts_Import.getimportstatus(\'' + progresskey + '\')', 500); + window.setTimeout('Contacts_Import.getimportstatus(\'' + progresskey + '\')', 500);
});
$('#contacts').change(function(){
if($('#contacts option:selected').val() == 'newaddressbook'){
@@ -65,11 +65,11 @@ Contacts_Import={ }
});
},
- getimportstatus: function(progresskey){ - $.get(OC.filePath('contacts', '', 'import.php') + '?progress=1&progresskey=' + progresskey, function(percent){ + getimportstatus: function(progresskey){
+ $.get(OC.filePath('contacts', '', 'import.php') + '?progress=1&progresskey=' + progresskey, function(percent){
$('#progressbar').progressbar('option', 'value', parseInt(percent));
if(percent < 100){
- window.setTimeout('Contacts_Import.getimportstatus(\'' + progresskey + '\')', 500); + window.setTimeout('Contacts_Import.getimportstatus(\'' + progresskey + '\')', 500);
}else{
$('#import_done').css('display', 'block');
}
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index a8ad695f620..71a874d783b 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -188,6 +188,7 @@ class OC_Contacts_VCard{ if($upgrade && in_array($property->name, $stringprops)) { self::decodeProperty($property); } + $property->value = str_replace("\r\n", "\n", iconv(mb_detect_encoding($property->value, 'UTF-8, ISO-8859-1'), 'utf-8', $property->value)); if(in_array($property->name, $stringprops)) { $property->value = strip_tags($property->value); } @@ -373,6 +374,10 @@ class OC_Contacts_VCard{ public static function editFromDAVData($aid,$uri,$data){ $oldcard = self::findWhereDAVDataIs($aid,$uri); $card = OC_VObject::parse($data); + if(!$card) { + OCP\Util::writeLog('contacts','OC_Contacts_VCard::editFromDAVData. Unable to parse VCARD, uri: '.$uri,OCP\Util::ERROR); + return false; + } return self::edit($oldcard['id'], $card); } diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php index fee5be08004..ca682baaf80 100644 --- a/apps/contacts/templates/part.contact.php +++ b/apps/contacts/templates/part.contact.php @@ -3,6 +3,7 @@ $id = isset($_['id']) ? $_['id'] : ''; ?> <div id="card"> <form class="float" id="file_upload_form" action="<?php echo OCP\Util::linkTo('contacts', 'ajax/uploadphoto.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target"> + <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>"> <input type="hidden" name="id" value="<?php echo $_['id'] ?>"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload"> <input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)"> @@ -23,6 +24,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <div id="contact_identity" class="contactsection"> <form method="post"> <input type="hidden" name="id" value="<?php echo $_['id'] ?>"> + <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>"> <fieldset id="ident" class="contactpart"> <span class="propertycontainer" data-element="N"><input type="hidden" id="n" class="contacts_property" name="value" value="" /></span> <span id="name" class="propertycontainer" data-element="FN"> @@ -34,7 +36,7 @@ $id = isset($_['id']) ? $_['id'] : ''; <dd class="propertycontainer hidden" id="org_value" data-element="ORG"><input id="org" required="required" name="value[ORG]" type="text" class="contacts_property big" name="value" value="" placeholder="<?php echo $l->t('Organization'); ?>" /><a role="button" class="action delete" title="<?php echo $l->t('Delete'); ?>"></a></dd> <dt class="hidden" id="nickname_label" data-element="NICKNAME"><label for="nickname"><?php echo $l->t('Nickname'); ?></label></dt> <dd class="propertycontainer hidden" id="nickname_value" data-element="NICKNAME"><input id="nickname" required="required" name="value[NICKNAME]" type="text" class="contacts_property big" name="value" value="" placeholder="<?php echo $l->t('Enter nickname'); ?>" /><a role="button" class="action delete" title="<?php echo $l->t('Delete'); ?>"></a></dd> - <dt class="hidden" id="url_label" data-element="URL"><label for="nickname"><?php echo $l->t('Web site'); ?></label></dt> + <dt class="hidden" id="url_label" data-element="URL"><label for="url"><?php echo $l->t('Web site'); ?></label></dt> <dd class="propertycontainer hidden" id="url_value" data-element="URL"><input id="url" required="required" name="value[URL]" type="text" class="contacts_property big" name="value" value="" placeholder="<?php echo $l->t('http://www.somesite.com'); ?>" /><a role="button" class="action globe" title="<?php echo $l->t('Go to web site'); ?>"><a role="button" class="action delete" title="<?php echo $l->t('Delete'); ?>"></a></dd> <dt class="hidden" id="bday_label" data-element="BDAY"><label for="bday"><?php echo $l->t('Birthday'); ?></label></dt> <dd class="propertycontainer hidden" id="bday_value" data-element="BDAY"><input id="bday" required="required" name="value" type="text" class="contacts_property big" value="" placeholder="<?php echo $l->t('dd-mm-yyyy'); ?>" /><a role="button" class="action delete" title="<?php echo $l->t('Delete'); ?>"></a></dd> diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index 57517505405..00a61f72fdd 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -8,5 +8,5 @@ } } ?> - <li role="button" book-id="<?php echo $contact['addressbookid']; ?>" data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo htmlspecialchars($display); ?></a></li> + <li role="button" book-id="<?php echo $contact['addressbookid']; ?>" data-id="<?php echo $contact['id']; ?>"><a href="index.php?id=<?php echo $contact['id']; ?>"><?php echo $display; ?></a></li> <?php endforeach; ?> diff --git a/apps/contacts/templates/part.cropphoto.php b/apps/contacts/templates/part.cropphoto.php index d7f0efc57d7..1079afc808a 100644 --- a/apps/contacts/templates/part.cropphoto.php +++ b/apps/contacts/templates/part.cropphoto.php @@ -1,6 +1,7 @@ <?php $id = $_['id']; $tmpkey = $_['tmpkey']; +$requesttoken = $_['requesttoken']; OCP\Util::writeLog('contacts','templates/part.cropphoto.php: tmpkey: '.$tmpkey, OCP\Util::DEBUG); ?> <script language="Javascript"> @@ -48,6 +49,7 @@ OCP\Util::writeLog('contacts','templates/part.cropphoto.php: tmpkey: '.$tmpkey, action="<?php echo OCP\Util::linkToAbsolute('contacts', 'ajax/savecrop.php'); ?>"> <input type="hidden" id="id" name="id" value="<?php echo $id; ?>" /> + <input type="hidden" name="requesttoken" value="<?php echo $requesttoken; ?>"> <input type="hidden" id="tmpkey" name="tmpkey" value="<?php echo $tmpkey; ?>" /> <fieldset id="coords"> <input type="hidden" id="x1" name="x1" value="" /> diff --git a/apps/contacts/templates/part.importaddressbook.php b/apps/contacts/templates/part.importaddressbook.php index 0e2956ddaf4..01f8dd77d0a 100644 --- a/apps/contacts/templates/part.importaddressbook.php +++ b/apps/contacts/templates/part.importaddressbook.php @@ -7,10 +7,6 @@ */ ?> <td id="importaddressbook_dialog" colspan="6"> -<?php -if(OCP\App::isEnabled('files_encryption')) { - echo '<strong>'.$l->t('Currently this import function doesn\'t work while encryption is enabled.<br />Please upload your VCF file with the file manager and click on it to import.').'</strong>'; -} else { ?> <table> <tr> <th><?php echo $l->t('Select address book to import to:') ?></th> @@ -33,7 +29,6 @@ if(OCP\App::isEnabled('files_encryption')) { <input id="close_button" style="float: left;" type="button" onclick="Contacts.UI.Addressbooks.cancel(this);" value="<?php echo $l->t("Cancel"); ?>"> <iframe name="import_upload_target" id='import_upload_target' src=""></iframe> -<?php } ?> </td> <script type="text/javascript"> $(document).ready(function(){ |