Merge branch 'master' of gitorious.org:owncloud/owncloud

This commit is contained in:
Robin Appelman 2011-10-05 02:11:44 +02:00
commit a8621265e2
71 changed files with 526 additions and 450 deletions

View File

@ -10,6 +10,7 @@ select.chzn-select {
display: inline-block;
zoom: 1;
*display: inline;
vertical-align: bottom;
}
.chzn-container .chzn-drop {
background: #fff;

View File

@ -1,12 +1,12 @@
<form id="export" action="#" method="post">
<fieldset class="personalblock">
<legend><strong>Export this ownCloud instance</strong></legend>
<p>This will create a compressed file that contains the data of this owncloud instance.
Please choose which components should be included:
<legend><strong><?php echo $l->t('Export this ownCloud instance');?></strong></legend>
<p><?php echo $l->t('This will create a compressed file that contains the data of this owncloud instance.
Please choose which components should be included:');?>
</p>
<p><input type="checkbox" id="user_files" name="user_files" value="true"><label for="user_files">User files</label><br/>
<input type="checkbox" id="owncloud_system" name="owncloud_system" value="true"><label for="owncloud_system">ownCloud system files</label><br/>
<input type="checkbox" id="owncloud_config" name="owncloud_config" value="true"><label for="owncloud_config">ownCloud configuration</label>
<p><input type="checkbox" id="user_files" name="user_files" value="true"><label for="user_files"><?php echo $l->t('User files');?></label><br/>
<input type="checkbox" id="owncloud_system" name="owncloud_system" value="true"><label for="owncloud_system"><?php echo $l->t('ownCloud system files');?></label><br/>
<input type="checkbox" id="owncloud_config" name="owncloud_config" value="true"><label for="owncloud_config"><?php echo $l->t('ownCloud configuration');?></label>
</p>
<input type="submit" name="admin_export" value="Export" />
</fieldset>

View File

@ -1,8 +1,8 @@
<div class="bookmarks_addBm">
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<? echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<? echo $_['TITLE']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<? echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Address'); ?></label><input type="text" id="bookmark_add_url" class="bookmarks_input" value="<?php echo $_['URL']; ?>"/></p>
<p><label class="bookmarks_label"><?php echo $l->t('Title'); ?></label><input type="text" id="bookmark_add_title" class="bookmarks_input" value="<?php echo $_['TITLE']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Description'); ?></label><input type="text" id="bookmark_add_description" class="bookmarks_input" value="<?php echo $_['DESCRIPTION']; ?>" /></p>
<p><label class="bookmarks_label"><?php echo $l->t('Tags'); ?></label><input type="text" id="bookmark_add_tags" class="bookmarks_input" /></p>
<p><label class="bookmarks_label"> </label><label class="bookmarks_hint"><?php echo $l->t('Hint: Use space to separate tags.'); ?></label></p>
<p><label class="bookmarks_label"></label><input type="submit" value="<?php echo $l->t('Add bookmark'); ?>" id="bookmark_add_submit" /></p>
</div>
</div>

View File

@ -11,10 +11,21 @@ $l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
$calendarcolor_options = array(
'ff0000', // "Red"
'00ff00', // "Green"
'ffff00', // "Yellow"
'808000', // "Olive"
'ffa500', // "Orange"
'ff7f50', // "Coral"
'ee82ee', // "Violet"
'ecc255', // dark yellow
);
OC_JSON::checkAppEnabled('calendar');
$calendar = OC_Calendar_Calendar::findCalendar($_GET['calendarid']);
$tmpl = new OC_Template("calendar", "part.editcalendar");
$tmpl->assign('new', false);
$tmpl->assign('calendarcolor_options', $calendarcolor_options);
$tmpl->assign('calendar', $calendar);
$tmpl->printPage();
?>

View File

@ -20,7 +20,7 @@ foreach($calendars as $calendar) {
$events = array_merge($events, $tmp);
$return['calendars'][$calendar['id']] = array(
'displayname' => $calendar['displayname'],
'color' => $calendar['calendarcolor']
'color' => '#'.$calendar['calendarcolor']
);
}

View File

@ -0,0 +1,20 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once('../../../lib/base.php');
$l10n = new OC_L10N('calendar');
if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('calendar');
$tmpl = new OC_Template('calendar', 'part.import');
$tmpl->printpage();
?>

View File

@ -6,6 +6,8 @@ OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Calendar_Hooks', 'deleteUser');
OC_Util::addScript('calendar','loader');
OC_App::register( array(
'order' => 10,
'id' => 'calendar',

View File

@ -58,3 +58,6 @@ color:#A9A9A9;
}
select#category{width:140px;}
button.category{margin:0 3px;}
.calendar-colorpicker-color{display:inline-block;width:20px;height:20px;margin-right:2px;cursor:pointer;}
.calendar-colorpicker-color.active{background-image:url("../../../core/img/jquery-ui/ui-icons_222222_256x240.png");background-position:-62px -143px;}

50
apps/calendar/import.php Normal file
View File

@ -0,0 +1,50 @@
<?php
/**
* Copyright (c) 2011 Georg Ehrke <ownclouddev at georgswebsite dot de>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
require_once ('../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_Util::checkAppEnabled('calendar');
if($_GET["import"] == "existing"){
$calid = $_GET["calid"];
$calendar = OC_Calendar_Calendar::findCalendar($calid);
if($calendar['userid'] != OC_User::getUser()){
OC_JSON::error();
exit;
}
if($_GET["path"] != ""){
$filename = $_GET["path"] . "/" . $_GET["file"];
}else{
$filename = "/" . $_GET["file"];
}
}else{
$id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname'], $_POST['description']);
OC_Calendar_Calendar::setCalendarActive($id, 1);
$calid = $id;
if($_POST["path"] != ""){
$filename = $_POST["path"] . "/" . $_POST["file"];
}else{
$filename = "/" . $_POST["file"];
}
}
$vcalendar = OC_Filesystem::file_get_contents($filename);
$vcalendar = explode("BEGIN:VEVENT", $vcalendar);
for($i = 1;$i < count($vcalendar);$i++){
$vcalendar[$i] = "BEGIN:VEVENT" . $vcalendar[$i];
}
for($i = 1;$i < count($vcalendar) - 1;$i++){
$vcalendar[$i] = $vcalendar[$i] . "END:VCALENDAR";
}
for($i = 1;$i < count($vcalendar);$i++){
$vcalendar[$i] = $vcalendar[0] . $vcalendar[$i];
}
for($i = 1;$i < count($vcalendar);$i++){
OC_Calendar_Object::add($calid, $vcalendar[$i]);
}
OC_JSON::success();
?>

View File

@ -483,9 +483,38 @@ Calendar={
},
edit:function(object, calendarid){
var tr = $(document.createElement('tr'))
.load(OC.filePath('calendar', 'ajax', 'editcalendar.php') + "?calendarid="+calendarid);
.load(OC.filePath('calendar', 'ajax', 'editcalendar.php') + "?calendarid="+calendarid,
function(){Calendar.UI.Calendar.colorPicker(this)});
$(object).closest('tr').after(tr).hide();
},
colorPicker:function(container){
// based on jquery-colorpicker at jquery.webspirited.com
var obj = $('.colorpicker', container);
var picker = $('<div class="calendar-colorpicker"></div>');
var size = 20;
//build an array of colors
var colors = {};
$(obj).children('option').each(function(i, elm) {
colors[i] = {};
colors[i].color = $(elm).val();
colors[i].label = $(elm).text();
});
for (var i in colors) {
picker.append('<span class="calendar-colorpicker-color ' + (colors[i].color == $(obj).children(":selected").val() ? ' active' : '') + '" rel="' + colors[i].label + '" style="background-color: #' + colors[i].color + '; width: ' + size + 'px; height: ' + size + 'px;"></span>');
}
picker.delegate(".calendar-colorpicker-color", "click", function() {
$(obj).val($(this).attr('rel'));
$(obj).change();
picker.children('.calendar-colorpicker-color.active').removeClass('active');
$(this).addClass('active');
});
$(obj).after(picker);
$(obj).css({
position: 'absolute',
left: -10000
});
},
submit:function(button, calendarid){
var displayname = $("#displayname_"+calendarid).val();
var active = $("#edit_active_"+calendarid+":checked").length;

View File

@ -0,0 +1,16 @@
function importdialog(directory, filename){
$("body").append("<div id=\"importdialogholder\"></div>");
$("#importdialogholder").load(OC.filePath('calendar', 'ajax', 'importdialog.php?filename=' + filename + '&path=' + directory));
}
$(document).ready(function(){
$('tr[data-file$=".ics"]').attr("data-mime", "text/calendar");
$('tr[data-file$=".vcs"]').attr("data-mime", "text/calendar");
$('tr[data-file$=".ical"]').attr("data-mime", "text/calendar");
if(typeof FileActions!=='undefined'){
FileActions.register('text/calendar','Import to Calendar','',function(filename){
importdialog($('#dir').val(),filename);
});
FileActions.setDefault('text/calendar','Import to Calendar');
}
});

View File

@ -4,7 +4,7 @@ $(document).ready(function(){
// Serialize the data
var post = $( "#timezone" ).serialize();
$.post( OC.filePath('calendar', 'ajax', 'settimezone.php'), post, function(data){
OC.msg.finishedSaving('#calendar .msg', data);
//OC.msg.finishedSaving('#calendar .msg', data);
});
return false;
});
@ -27,12 +27,7 @@ $(document).ready(function(){
$("#selectweekend_" + day).attr('selected',true);
}
}
$("#weekend").multiselect({
header: false,
noneSelectedText: $('#weekend').attr('title'),
selectedList: 2,
minWidth:'auto',
});
$("#weekend").chosen();
});
$("#timeformat").change( function(){
var data = $("#timeformat").serialize();

View File

@ -34,7 +34,14 @@
<tr>
<th><?php echo $l->t('Calendar color') ?></th>
<td>
<input id="calendarcolor_<?php echo $_['calendar']['id'] ?>" type="text" value="<?php echo $_['calendar']['calendarcolor'] ?>">
<select id="calendarcolor_<?php echo $_['calendar']['id'] ?>" class="colorpicker">
<?php
if (!isset($_['calendar']['calendarcolor'])) {$_['calendar']['calendarcolor'] = false;}
foreach($_['calendarcolor_options'] as $color){
echo '<option value="' . $color . '"' . ($_['calendar']['calendarcolor'] == $color ? ' selected="selected"' : '') . '>' . $color . '</option>';
}
?>
</select>
</td>
</tr>
</table>

View File

@ -12,8 +12,8 @@
<td>
<select id="category" name="categories[]" multiple="multiple" title="<?php echo $l->t("Select category") ?>">
<?php
if (!isset($_['categories'])) {$_['categories'] = array();}
foreach($_['category_options'] as $category){
if (!isset($_['categories'])) {$_['categories'] = array();}
echo '<option value="' . $category . '"' . (in_array($category, $_['categories']) ? ' selected="selected"' : '') . '>' . $category . '</option>';
}
?>
@ -22,8 +22,8 @@
<td>
<select style="width:140px;" name="calendar">
<?php
if (!isset($_['calendar'])) {$_['calendar'] = false;}
foreach($_['calendar_options'] as $calendar){
if (!isset($_['calendar'])) {$_['calendar'] = false;}
echo '<option value="' . $calendar['id'] . '"' . ($_['calendar'] == $calendar['id'] ? ' selected="selected"' : '') . '>' . $calendar['displayname'] . '</option>';
}
?>

View File

@ -1,87 +0,0 @@
<div id="eventinfo" title="<?php echo $l -> t("Edit an event");?>">
<table id="eventinfo_table" width="100%">
<tr>
<td width="75px"><?php echo $l -> t("Title");?>:</td>
<td>
</td>
</tr>
<tr>
<td width="75px"><?php echo $l -> t("Location");?>:</td>
<td>
</td>
</tr>
</table>
<table>
<tr>
<td width="75px"><?php echo $l -> t("Category");?>:</td>
<td></td>
<td width="75px">&nbsp;&nbsp;&nbsp;<?php echo $l -> t("Calendar");?>:</td>
<td></td>
</tr>
</table>
<hr>
<table>
<tr>
<td width="75px"></td>
<td>
<input type="checkbox" id="newcalendar_allday_checkbox" disabled="true">
<label for="newcalendar_allday_checkbox"><?php echo $l -> t("All Day Event");?></label></td>
</tr>
<tr>
<td width="75px"><?php echo $l -> t("From");?>:</td>
<td>
&nbsp;&nbsp;
</td><!--use jquery-->
</tr>
<tr>
<td width="75px"><?php echo $l -> t("To");?>:</td>
<td>
&nbsp;&nbsp;
</td><!--use jquery-->
</tr>
<tr>
<td width="75px"><?php echo $l -> t("Repeat");?>:</td>
<td></td>
</tr>
</table>
<hr>
<table>
<tr>
<td width="75px"><?php echo $l -> t("Attendees");?>:</td>
<td style="height: 50px;"></td>
</tr>
</table>
<hr>
<table>
<tr>
<td width="75px" style="vertical-align: top;"><?php echo $l -> t("Description");?>:</td>
<td></td>
</tr>
</table>
<span id="editevent_actions">
<input type="button" style="float: left;" value="<?php echo $l -> t("Close");?>">
<input type="button" style="float: right;" value="<?php echo $l -> t("Edit");?>">
</span>
</div>
<script type="text/javascript">
$( "#eventinfo" ).dialog({
width : 500,
close : function() {
oc_cal_opendialog = 0;
var lastchild = document.getElementById("body-user").lastChild
while(lastchild.id != "lightbox"){
document.getElementById("body-user").removeChild(lastchild);
lastchild = document.getElementById("body-user").lastChild;
}
},
open : function(){alert("Doesn't work yet.");}
});
$( "#from" ).datepicker({
dateFormat : 'dd-mm-yy'
});
$( "#to" ).datepicker({
dateFormat : 'dd-mm-yy'
});
}
</script>

View File

@ -0,0 +1,75 @@
<div id="importdialog" title="<?php echo $l->t("Import Ical File"); ?>">
<input type="hidden" id="filename" value="<?php echo $_GET["filename"];?>">
<input type="hidden" id="path" value="<?php echo $_GET["path"];?>">
<div id="first"><strong style="text-align: center;margin: 0 auto;"><?php echo $l->t("How to import the new calendar?");?></strong>
<br><br>
<input style="float: left;" type="button" value="<?php echo $l->t("Import into an existing calendar"); ?>" onclick="$('#first').css('display', 'none');$('#existingcal').css('display', 'block');">
<input style="float: right;" type="button" value="<?php echo $l->t("Import into a new calendar");?>" onclick="$('#first').css('display', 'none');$('#newcal').css('display', 'block');">
</div>
<div id="existingcal" style="display: none;">
<strong><?php echo $l->t("Please choose the calendar"); ?></strong><br><br>
<form id="inputradioform">
<?php
$calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser());
foreach($calendars as $calendar){
echo '<input type="radio" style="width: 20px;" name="calendar" id="radio_' . $calendar["id"] . '" value="' . $calendar["id"] . '">' . $calendar["displayname"] . '<br>';
}
?>
</form>
<br><br>
<input type="button" value="<?php echo $l->t("Import");?>!" onclick="importcal('existing');">
<br><br>
<input type="button" value="<?php echo $l->t("Back");?>" onclick="$('#existingcal').css('display', 'none');$('#first').css('display', 'block');">
</div>
<div id="newcal" style="display: none;">
<strong><?php echo $l->t("Please fill out the form"); ?></strong>
<!-- modified part of part.editcalendar.php -->
<table width="100%" style="border: 0;">
<tr>
<th><?php echo $l->t('Displayname') ?></th>
<td>
<input id="displayname" type="text" value="">
</td>
</tr>
<th><?php echo $l->t('Description') ?></th>
<td>
<textarea id="description"></textarea>
</td>
</tr>
</table>
<!-- end of modified part -->
<br><br>
<input type="button" value="<?php echo $l->t("Import");?>!" onclick="importcal('new');">
<br><br>
<input type="button" value="<?php echo $l->t("Back");?>" onclick="$('#newcal').css('display', 'none');$('#first').css('display', 'block');">
</div>
</div>
<script type="text/javascript">
$("input:radio[name='calendar']:first").attr("checked","checked");
$("#importdialog").dialog({
width : 500,
close : function(event, ui) {
$(this).dialog('destroy').remove();
$("#importdialogholder").remove();
}
});
function importcal(importtype){
var path = $("#path").val();
var file = $("#filename").val();
if(importtype == "existing"){
var calid = $("input:radio[name='calendar']:checked").val();
$.getJSON(OC.filePath('calendar', '', 'import.php') + "?import=existing&calid=" + calid + "&path=" + path + "&file=" + file, function(){
$("#importdialog").dialog('destroy').remove();
$("#importdialogholder").remove();
});
}
if(importtype == "new"){
var calname = $("#displayname").val();
var description = $("#description").val();
$.post(OC.filePath('calendar', '', 'import.php'), {'import':'new', 'calname':calname, 'description':description, 'path':path, 'file':file}, function(){
$("#importdialog").dialog('destroy').remove();
$("#importdialogholder").remove();
});
}
}
</script>

View File

@ -11,8 +11,8 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
?>
<form id="calendar">
<fieldset class="personalblock">
<label for="timezone"><strong><?php echo $l->t('Timezone');?></strong></label>
<select style="display: none;" id="timezone" name="timezone">
<table class="nostyle">
<tr><td><label for="timezone" class="bold"><?php echo $l->t('Timezone');?></label></td><td><select style="display: none;" id="timezone" name="timezone">
<?php
$continent = '';
foreach($_['timezones'] as $timezone):
@ -27,34 +27,41 @@ OC_UTIL::addStyle('', 'jquery.multiselect');
echo '<option value="'.$timezone.'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.$city.'</option>';
endif;
endforeach;?>
</select><span class="msg"></span>&nbsp;&nbsp;
<label for="firstdayofweek"><strong><?php echo $l->t('First day of the week');?></strong></label>
<select style="display: none;" id="firstdayofweek" name="firstdayofweek">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select>&nbsp;&nbsp;
<label for="weekend"><strong><?php echo $l->t('Days of weekend');?></strong></label>
<select id="weekend" name="weekend[]" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select>&nbsp;&nbsp;
<label for="timeformat"><strong><?php echo $l->t('Timeformat');?></strong></label>
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
<option value="24" id="24h"><?php echo $l->t("24 h"); ?></option>
<option value="ampm" id="ampm"><?php echo $l->t("am/pm"); ?></option>
</select>&nbsp;&nbsp;
<label for="duration"><strong><?php echo $l->t('Event duration');?></strong></label>
<input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <strong><?php echo $l->t("Minutes");?></strong>
<br />
Calendar CalDAV syncing address:
</select></td></tr>
<tr><td><label for="timeformat" class="bold"><?php echo $l->t('Timeformat');?></label></td><td>
<select style="display: none;" id="timeformat" title="<?php echo "timeformat"; ?>" name="timeformat">
<option value="24" id="24h"><?php echo $l->t("24h"); ?></option>
<option value="ampm" id="ampm"><?php echo $l->t("12h"); ?></option>
</select>
</td></tr>
<tr><td><label for="firstdayofweek" class="bold"><?php echo $l->t('First day of the week');?></label></td><td>
<select style="display: none;" id="firstdayofweek" name="firstdayofweek">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$i.'" id="select_'.$i.'">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select>
</td></tr>
<tr><td><label for="weekend" class="bold"><?php echo $l->t('Days of weekend');?></label></td><td>
<select id="weekend" name="weekend[]" style="width: 30em;" multiple="multiple" title="<?php echo $l->t("Weekend"); ?>">
<?php
$weekdays = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
for($i = 0;$i <= 6;$i++){
echo '<option value="'.$weekdays[$i].'" id="selectweekend_' . $weekdays[$i] . '">' . $l->t($weekdays[$i]) . '</option>';
}
?>
</select>
</td></tr>
<tr><td><label for="duration" class="bold"><?php echo $l->t('Event duration');?></label></td><td><input type="text" maxlength="3" size="3" style="width: 2em;" id="duration" name="duration" /> <?php echo $l->t("Minutes");?></td></tr>
</table>
<?php echo $l->t('Calendar CalDAV syncing address:');?>
<?php echo OC_Helper::linkTo('apps/calendar', 'caldav.php', null, true); ?><br />
</fieldset>
</form>

View File

@ -53,16 +53,7 @@ $name = $_POST['name'];
$value = $_POST['value'];
$parameters = isset($_POST['parameteres'])?$_POST['parameters']:array();
if(is_array($value)){
$value = OC_Contacts_VCard::escapeSemicolons($value);
}
$property = new Sabre_VObject_Property( $name, $value );
$parameternames = array_keys($parameters);
foreach($parameternames as $i){
$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
}
$vcard->add($property);
OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters);
$line = count($vcard->children) - 1;
$checksum = md5($property->serialize());

View File

@ -104,6 +104,8 @@ $(document).ready(function(){
if(jsondata.status == 'success'){
$('#rightcontent').data('id',jsondata.data.id);
$('#rightcontent').html(jsondata.data.page);
$('#leftcontent .active').removeClass('active');
$('#leftcontent ul').append('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'">'+jsondata.data.name+'</a></li>');
}
else{
alert(jsondata.data.message);

View File

@ -246,7 +246,7 @@ class OC_Contacts_VCard{
public static function escapeSemicolons($value){
foreach($value as &$i ){
$i = implode("\\\\;", explode(';', $i));
} unset($i);
}
return implode(';',$value);
}
@ -272,6 +272,26 @@ class OC_Contacts_VCard{
return $array;
}
/**
* @brief Add property to vcard object
* @param object $vcard
* @param object $name of property
* @param object $value of property
* @param object $paramerters of property
*/
public static function addVCardProperty($vcard, $name, $value, $parameters=array()){
if(is_array($value)){
$value = OC_Contacts_VCard::escapeSemicolons($value);
}
$property = new Sabre_VObject_Property( $name, $value );
$parameternames = array_keys($parameters);
foreach($parameternames as $i){
$property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]);
}
$vcard->add($property);
}
/**
* @brief Data structure of vCard
* @param object $property

View File

@ -11,5 +11,41 @@
<?php endif; ?>
<label for="fn"><?php echo $l->t('Name'); ?></label>
<input type="text" name="fn" value=""><br>
<label for="ADR"><?php echo $l->t('Address'); ?></label>
<div id="contacts_addresspart">
<select id="ADR" name="parameters[ADR][TYPE]" size="1">
<option value="adr_work"><?php echo $l->t('Work'); ?></option>
<option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
<p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p>
<p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p>
<p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p>
<p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p>
<p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p>
</div>
<label for="TEL"><?php echo $l->t('Telephone'); ?></label>
<div id="contacts_phonepart">
<select id="TEL" name="parameters[TEL][TYPE]" size="1">
<option value="home"><?php echo $l->t('Home'); ?></option>
<option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option>
<option value="work"><?php echo $l->t('Work'); ?></option>
<option value="text"><?php echo $l->t('Text'); ?></option>
<option value="voice"><?php echo $l->t('Voice'); ?></option>
<option value="fax"><?php echo $l->t('Fax'); ?></option>
<option value="video"><?php echo $l->t('Video'); ?></option>
<option value="pager"><?php echo $l->t('Pager'); ?></option>
</select>
<input type="text" name="value[TEL]" value="">
</div>
<label for="EMAIL"><?php echo $l->t('Email'); ?></label>
<div id="contacts_email">
<input id="EMAIL" type="text" name="value[EMAIL]" value="">
</div>
<label for="ORG"><?php echo $l->t('Organization'); ?></label>
<div id="contacts_organisation">
<input id="ORG" type="text" name="value[ORG]" value="">
</div>
<input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>">
</form>

View File

@ -1,11 +1,11 @@
<fieldset>
<legend>Your Shared Files</legend>
<legend><?php echo $l->t('Your Shared Files');?></legend>
<table id="itemlist">
<thead>
<tr>
<th>Item</th>
<th>Shared With</th>
<th>Permissions</th>
<th><?php echo $l->t('Item');?></th>
<th><?php echo $l->t('Shared With');?></th>
<th><?php echo $l->t('Permissions');?></th>
</tr>
</thead>
<tbody>
@ -13,8 +13,8 @@
<tr class="item">
<td class="source"><?php echo substr($item['source'], strlen("/".$_SESSION['user_id']."/files/"));?></td>
<td class="uid_shared_with"><?php echo $item['uid_shared_with'];?></td>
<td class="permissions"><?php echo "Read"; echo($item['permissions'] & OC_SHARE::WRITE ? ", Edit" : ""); echo($item['permissions'] & OC_SHARE::DELETE ? ", Delete" : "");?></td>
<td><button class="delete" data-source="<?php echo $item['source'];?>" data-uid_shared_with="<?php echo $item['uid_shared_with'];?>">Delete</button></td>
<td class="permissions"><?php echo $l->t('Read'); echo($item['permissions'] & OC_SHARE::WRITE ? ", ".$l->t('Edit') : ""); echo($item['permissions'] & OC_SHARE::DELETE ? ", ".$l->t('Delete') : "");?></td>
<td><button class="delete" data-source="<?php echo $item['source'];?>" data-uid_shared_with="<?php echo $item['uid_shared_with'];?>"><?php echo $l->t('Delete');?></button></td>
</tr>
<?php endforeach;?>
<tr id="share_item_row">

View File

@ -18,7 +18,7 @@ a.jp-mute,a.jp-unmute { left:24em; }
div.jp-volume-bar { position:absolute; overflow:hidden; background:#eee; width:4em; height:0.4em; cursor:pointer; top:1.3em; left:27em; }
div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
#collection { padding-top:1em; position:relative; width:70em; float:left; }
#collection { padding-top:1em; position:relative; width:100%; float:left; }
#collection li.album,#collection li.song { margin-left:3em; }
#leftcontent img.remove { display:none; float:right; cursor:pointer; }
#leftcontent li:hover img.remove { display:inline; }

View File

@ -0,0 +1,5 @@
<?php
OC_App::register( array(
'order' => 10,
'id' => 'remoteStorage',
'name' => 'remoteStorage compatibility' ));

View File

@ -43,7 +43,7 @@
<length>64</length>
</field>
<index>
<name>a_app_unhostedweb_user</name>
<name>a_app_remotestorage_user</name>
<unique>true</unique>
<field>
<name>user</name>

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<info>
<id>remoteStorage</id>
<name>remoteStorage compatibility</name>
<description>Enables your users to use ownCloud as their remote storage for unhosted applications.</description>
<version>0.1</version>
<licence>AGPL</licence>
<author>Michiel de Jong</author>
<require>2</require>
</info>

View File

@ -30,16 +30,16 @@
$RUNTIME_NOSETUPFS = true;
require_once('../../lib/base.php');
OC_Util::checkAppEnabled('unhosted');
OC_Util::checkAppEnabled('remoteStorage');
require_once('Sabre/autoload.php');
require_once('lib_unhosted.php');
require_once('lib_remoteStorage.php');
require_once('oauth_ro_auth.php');
ini_set('default_charset', 'UTF-8');
#ini_set('error_reporting', '');
@ob_clean();
//allow use as unhosted storage for other websites
//allow use as remote storage for other websites
if(isset($_SERVER['HTTP_ORIGIN'])) {
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']);
header('Access-Control-Max-Age: 3600');
@ -53,12 +53,12 @@ $path = substr($_SERVER["REQUEST_URI"], strlen($_SERVER["SCRIPT_NAME"]));
$pathParts = explode('/', $path);
// for webdav:
// 0/ 1 / 2 / 3 / 4 / 5 / 6 / 7
// /$ownCloudUser/unhosted/webdav/$userHost/$userName/$dataScope/$key
// /$ownCloudUser/remoteStorage/webdav/$userHost/$userName/$dataScope/$key
// for oauth:
// 0/ 1 / 2 / 3 / 4
// /$ownCloudUser/unhosted/oauth/auth
// /$ownCloudUser/remoteStorage/oauth/auth
if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' && $pathParts[3] == 'webdav') {
if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'remoteStorage' && $pathParts[3] == 'webdav') {
list($dummy0, $ownCloudUser, $dummy2, $dummy3, $userHost, $userName, $dataScope) = $pathParts;
OC_Util::setupFS($ownCloudUser);
@ -68,10 +68,10 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
$server = new Sabre_DAV_Server($publicDir);
// Path to our script
$server->setBaseUri(OC::$WEBROOT."/apps/unhosted/compat.php/$ownCloudUser");
$server->setBaseUri(OC::$WEBROOT."/apps/remoteStorage/compat.php/$ownCloudUser");
// Auth backend
$authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_UnhostedWeb::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope));
$authBackend = new OC_Connector_Sabre_Auth_ro_oauth(OC_remoteStorage::getValidTokens($ownCloudUser, $userName.'@'.$userHost, $dataScope));
$authPlugin = new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud');//should use $validTokens here
$server->addPlugin($authPlugin);
@ -83,7 +83,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
// And off we go!
$server->exec();
} else if(count($pathParts) >= 4 && $pathParts[0] == '' && $pathParts[2] == 'unhosted' && $pathParts[3] == 'oauth2' && $pathParts[4] = 'auth') {
} else if(count($pathParts) >= 4 && $pathParts[0] == '' && $pathParts[2] == 'remoteStorage' && $pathParts[3] == 'oauth2' && $pathParts[4] = 'auth') {
if(isset($_POST['allow'])) {
//TODO: input checking. these explodes may fail to produces the desired arrays:
$ownCloudUser = $pathParts[1];
@ -98,8 +98,8 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
}
if(OC_User::getUser() == $ownCloudUser) {
//TODO: check if this can be faked by editing the cookie in firebug!
$token=OC_UnhostedWeb::createDataScope($appUrl, $userAddress, $dataScope);
header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=unhosted');
$token=OC_remoteStorage::createDataScope($appUrl, $userAddress, $dataScope);
header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=remoteStorage');
} else {
if($_SERVER['HTTPS']){
$url = "https://";
@ -107,7 +107,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'unhosted'
$url = "http://";
}
$url .= $_SERVER['SERVER_NAME'];
$url .= substr($_SERVER['SCRIPT_NAME'], 0, -strlen('apps/unhosted/compat.php'));
$url .= substr($_SERVER['SCRIPT_NAME'], 0, -strlen('apps/remoteStorage/compat.php'));
die('Please '
.'<input type="submit" onclick="'
."window.open('$url','Close me!','height=600,width=300');"

View File

@ -1,6 +1,6 @@
<?php
class OC_UnhostedWeb {
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($user,$userAddress,$dataScope));
@ -66,7 +66,7 @@ class OC_UnhostedWeb {
//TODO: input checking on $userAddress and $dataScope
list($userName, $userHost) = explode('@', $userAddress);
OC_Util::setupFS(OC_User::getUser());
$scopePathParts = array('unhosted', 'webdav', $userHost, $userName, $dataScope);
$scopePathParts = array('remoteStorage', 'webdav', $userHost, $userName, $dataScope);
for($i=0;$i<=count($scopePathParts);$i++){
$thisPath = '/'.implode('/', array_slice($scopePathParts, 0, $i));
if(!OC_Filesystem::file_exists($thisPath)) {

View File

@ -1,5 +0,0 @@
<?php
OC_App::register( array(
'order' => 10,
'id' => 'unhosted',
'name' => 'Unhosted Web' ));

View File

@ -1,10 +0,0 @@
<?xml version="1.0"?>
<info>
<id>unhosted</id>
<name>Unhosted Web</name>
<description>On websites that allow unhosted accounts, use your owncloud as the storage for your user data</description>
<version>0.1</version>
<licence>AGPL</licence>
<author>Michiel de Jong</author>
<require>2</require>
</info>

View File

@ -1,11 +1,4 @@
<?php
// comment out this line:
die("This feature is still experimental. Please comment out this line in the code, then try again\n");
//
$ownCloudBaseUri = substr($_SERVER['REQUEST_URI'],0, -(strlen('/apps/user_webfinger/activate.php')));
$thisAppDir = __DIR__;
$appsDir = dirname($thisAppDir);

View File

@ -2,7 +2,7 @@
<info>
<id>user_webfinger</id>
<name>Webfinger</name>
<description>Provide webfinger for all users, so that they can use their ownCloud account as their remote storage on the web. If you don't run owncloud in the root of your domain, for instance if you run it on http://example.com/owncloud/, then makes sure you link http://example.com/.well-known/ to http://example.com/owncloud/apps/user_webfinger/ - for instance by running something like "ln -s /var/www/owncloud/apps/user_webfinger /var/www/.well-known". Only enable this app if you run this owncloud installation on a public web address, not if you run it on an intranet or on localhost.</description>
<description>Provide WebFinger for all users so they get a user address like user@owncloudinstance which can be used for unhosted applications. If you don't run ownCloud in the root of your domain, for instance if you run it on example.com/owncloud/, then make sure you link example.com/.well-known/ to example.com/owncloud/apps/user_webfinger/ - by running something like "ln -s /var/www/owncloud/apps/user_webfinger /var/www/.well-known". Only enable this app if you run this ownCloud installation on a public web address, not if you run it on an intranet or on localhost.</description>
<version>0.1</version>
<licence>AGPL</licence>
<author>Michiel de Jong</author>

View File

@ -20,5 +20,5 @@ echo "<";
?xml version="1.0" encoding="UTF-8"?>
<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
<hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/unhosted/compat.php/<?php echo $userName ?>/unhosted/" />
<Link rel="http://unhosted.org/spec/dav/0.1" href="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/apps/remoteStorage/compat.php/<?php echo $userName ?>/remoteStorage/" />
</XRD>

View File

@ -34,191 +34,8 @@
.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
/* states and images */
.ui-icon { width: 16px; height: 16px; background-image: url(../img/jquery-ui/ui-icons_222222_256x240.png); }
.ui-widget-content .ui-icon {background-image: url(../img/jquery-ui/ui-icons_222222_256x240.png); }
.ui-widget-header .ui-icon {background-image: url(../img/jquery-ui/ui-icons_ffffff_256x240.png); }
.ui-state-default .ui-icon { background-image: url(../img/jquery-ui/ui-icons_ef8c08_256x240.png); }
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../img/jquery-ui/ui-icons_ef8c08_256x240.png); }
.ui-state-active .ui-icon {background-image: url(../img/jquery-ui/ui-icons_ef8c08_256x240.png); }
.ui-state-highlight .ui-icon {background-image: url(../img/jquery-ui/ui-icons_228ef1_256x240.png); }
.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(../img/jquery-ui/ui-icons_ffd27a_256x240.png); }
/* positioning */
.ui-icon-carat-1-n { background-position: 0 0; }
.ui-icon-carat-1-ne { background-position: -16px 0; }
.ui-icon-carat-1-e { background-position: -32px 0; }
.ui-icon-carat-1-se { background-position: -48px 0; }
.ui-icon-carat-1-s { background-position: -64px 0; }
.ui-icon-carat-1-sw { background-position: -80px 0; }
.ui-icon-carat-1-w { background-position: -96px 0; }
.ui-icon-carat-1-nw { background-position: -112px 0; }
.ui-icon-carat-2-n-s { background-position: -128px 0; }
.ui-icon-carat-2-e-w { background-position: -144px 0; }
.ui-icon-triangle-1-n { background-position: 0 -16px; }
.ui-icon-triangle-1-ne { background-position: -16px -16px; }
.ui-icon-triangle-1-e { background-position: -32px -16px; }
.ui-icon-triangle-1-se { background-position: -48px -16px; }
.ui-icon-triangle-1-s { background-position: -64px -16px; }
.ui-icon-triangle-1-sw { background-position: -80px -16px; }
.ui-icon-triangle-1-w { background-position: -96px -16px; }
.ui-icon-triangle-1-nw { background-position: -112px -16px; }
.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
.ui-icon-arrow-1-n { background-position: 0 -32px; }
.ui-icon-arrow-1-ne { background-position: -16px -32px; }
.ui-icon-arrow-1-e { background-position: -32px -32px; }
.ui-icon-arrow-1-se { background-position: -48px -32px; }
.ui-icon-arrow-1-s { background-position: -64px -32px; }
.ui-icon-arrow-1-sw { background-position: -80px -32px; }
.ui-icon-arrow-1-w { background-position: -96px -32px; }
.ui-icon-arrow-1-nw { background-position: -112px -32px; }
.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
.ui-icon-arrow-4 { background-position: 0 -80px; }
.ui-icon-arrow-4-diag { background-position: -16px -80px; }
.ui-icon-extlink { background-position: -32px -80px; }
.ui-icon-newwin { background-position: -48px -80px; }
.ui-icon-refresh { background-position: -64px -80px; }
.ui-icon-shuffle { background-position: -80px -80px; }
.ui-icon-transfer-e-w { background-position: -96px -80px; }
.ui-icon-transferthick-e-w { background-position: -112px -80px; }
.ui-icon-folder-collapsed { background-position: 0 -96px; }
.ui-icon-folder-open { background-position: -16px -96px; }
.ui-icon-document { background-position: -32px -96px; }
.ui-icon-document-b { background-position: -48px -96px; }
.ui-icon-note { background-position: -64px -96px; }
.ui-icon-mail-closed { background-position: -80px -96px; }
.ui-icon-mail-open { background-position: -96px -96px; }
.ui-icon-suitcase { background-position: -112px -96px; }
.ui-icon-comment { background-position: -128px -96px; }
.ui-icon-person { background-position: -144px -96px; }
.ui-icon-print { background-position: -160px -96px; }
.ui-icon-trash { background-position: -176px -96px; }
.ui-icon-locked { background-position: -192px -96px; }
.ui-icon-unlocked { background-position: -208px -96px; }
.ui-icon-bookmark { background-position: -224px -96px; }
.ui-icon-tag { background-position: -240px -96px; }
.ui-icon-home { background-position: 0 -112px; }
.ui-icon-flag { background-position: -16px -112px; }
.ui-icon-calendar { background-position: -32px -112px; }
.ui-icon-cart { background-position: -48px -112px; }
.ui-icon-pencil { background-position: -64px -112px; }
.ui-icon-clock { background-position: -80px -112px; }
.ui-icon-disk { background-position: -96px -112px; }
.ui-icon-calculator { background-position: -112px -112px; }
.ui-icon-zoomin { background-position: -128px -112px; }
.ui-icon-zoomout { background-position: -144px -112px; }
.ui-icon-search { background-position: -160px -112px; }
.ui-icon-wrench { background-position: -176px -112px; }
.ui-icon-gear { background-position: -192px -112px; }
.ui-icon-heart { background-position: -208px -112px; }
.ui-icon-star { background-position: -224px -112px; }
.ui-icon-link { background-position: -240px -112px; }
.ui-icon-cancel { background-position: 0 -128px; }
.ui-icon-plus { background-position: -16px -128px; }
.ui-icon-plusthick { background-position: -32px -128px; }
.ui-icon-minus { background-position: -48px -128px; }
.ui-icon-minusthick { background-position: -64px -128px; }
.ui-icon-close { background-position: -80px -128px; }
.ui-icon-closethick { background-position: -96px -128px; }
.ui-icon-key { background-position: -112px -128px; }
.ui-icon-lightbulb { background-position: -128px -128px; }
.ui-icon-scissors { background-position: -144px -128px; }
.ui-icon-clipboard { background-position: -160px -128px; }
.ui-icon-copy { background-position: -176px -128px; }
.ui-icon-contact { background-position: -192px -128px; }
.ui-icon-image { background-position: -208px -128px; }
.ui-icon-video { background-position: -224px -128px; }
.ui-icon-script { background-position: -240px -128px; }
.ui-icon-alert { background-position: 0 -144px; }
.ui-icon-info { background-position: -16px -144px; }
.ui-icon-notice { background-position: -32px -144px; }
.ui-icon-help { background-position: -48px -144px; }
.ui-icon-check { background-position: -64px -144px; }
.ui-icon-bullet { background-position: -80px -144px; }
.ui-icon-radio-off { background-position: -96px -144px; }
.ui-icon-radio-on { background-position: -112px -144px; }
.ui-icon-pin-w { background-position: -128px -144px; }
.ui-icon-pin-s { background-position: -144px -144px; }
.ui-icon-play { background-position: 0 -160px; }
.ui-icon-pause { background-position: -16px -160px; }
.ui-icon-seek-next { background-position: -32px -160px; }
.ui-icon-seek-prev { background-position: -48px -160px; }
.ui-icon-seek-end { background-position: -64px -160px; }
.ui-icon-seek-start { background-position: -80px -160px; }
/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
.ui-icon-seek-first { background-position: -80px -160px; }
.ui-icon-stop { background-position: -96px -160px; }
.ui-icon-eject { background-position: -112px -160px; }
.ui-icon-volume-off { background-position: -128px -160px; }
.ui-icon-volume-on { background-position: -144px -160px; }
.ui-icon-power { background-position: 0 -176px; }
.ui-icon-signal-diag { background-position: -16px -176px; }
.ui-icon-signal { background-position: -32px -176px; }
.ui-icon-battery-0 { background-position: -48px -176px; }
.ui-icon-battery-1 { background-position: -64px -176px; }
.ui-icon-battery-2 { background-position: -80px -176px; }
.ui-icon-battery-3 { background-position: -96px -176px; }
.ui-icon-circle-plus { background-position: 0 -192px; }
.ui-icon-circle-minus { background-position: -16px -192px; }
.ui-icon-circle-close { background-position: -32px -192px; }
.ui-icon-circle-triangle-e { background-position: -48px -192px; }
.ui-icon-circle-triangle-s { background-position: -64px -192px; }
.ui-icon-circle-triangle-w { background-position: -80px -192px; }
.ui-icon-circle-triangle-n { background-position: -96px -192px; }
.ui-icon-circle-arrow-e { background-position: -112px -192px; }
.ui-icon-circle-arrow-s { background-position: -128px -192px; }
.ui-icon-circle-arrow-w { background-position: -144px -192px; }
.ui-icon-circle-arrow-n { background-position: -160px -192px; }
.ui-icon-circle-zoomin { background-position: -176px -192px; }
.ui-icon-circle-zoomout { background-position: -192px -192px; }
.ui-icon-circle-check { background-position: -208px -192px; }
.ui-icon-circlesmall-plus { background-position: 0 -208px; }
.ui-icon-circlesmall-minus { background-position: -16px -208px; }
.ui-icon-circlesmall-close { background-position: -32px -208px; }
.ui-icon-squaresmall-plus { background-position: -48px -208px; }
.ui-icon-squaresmall-minus { background-position: -64px -208px; }
.ui-icon-squaresmall-close { background-position: -80px -208px; }
.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
.ui-icon { width: 16px; height: 16px; }
.ui-icon-closethick { background-image: url(../img/actions/delete.png); }
/* Misc visuals
----------------------------------*/

View File

@ -15,9 +15,9 @@ body { background:#fefefe; font:normal .8em/1.6em "Lucida Grande", Arial, Verdan
/* HEADERS */
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px #000, inset 0 -2px 10px #222; box-shadow:0 0 10px #000, inset 0 -2px 10px #222; }
#body-user #header, #body-settings #header { position:fixed; top:0; z-index:100; width:100%; height:2.5em; padding:.5em; background:#1d2d44; -moz-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; -webkit-box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; box-shadow:0 0 10px rgba(0, 0, 0, .5), inset 0 -2px 10px #222; }
#body-login #header { margin: -2em auto 0; text-align:center; height:10em;
-moz-box-shadow:0 0 1em #000; -webkit-box-shadow:0 0 1em #000; box-shadow:0 0 1em #000;
-moz-box-shadow:0 0 1em rgba(0, 0, 0, .5); -webkit-box-shadow:0 0 1em rgba(0, 0, 0, .5); box-shadow:0 0 1em rgba(0, 0, 0, .5);
background: #1d2d44; /* Old browsers */
background: -moz-linear-gradient(top, #35537a 0%, #1d2d42 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#35537a), color-stop(100%,#1d2d42)); /* Chrome,Safari4+ */
@ -49,12 +49,11 @@ form.searchbox input[type="search"] { position:fixed; font-size:1.2em; top:.4em;
input[type="submit"].enabled { background:#66f866; border:1px solid #5e5; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #cfc inset; }
input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-shadow:#ffeedd 0 1px 0; -moz-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; box-shadow:0 1px 1px #f8f8f8, 0 1px 1px #ffeedd inset; }
/* CONTENT ------------------------------------------------------------------ */
#controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; }
#controls .button { display:inline-block; }
#content { margin:3.5em 0 0 12.5em; }
#leftcontent, .leftcontent { position:absolute; top:6.4em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; }
#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; }
#leftcontent li, .leftcontent li { padding:.3em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
#leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; }
#rightcontent, .rightcontent { position:absolute; top:6.4em; left:33em; }
@ -67,11 +66,14 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
#body-login p.info a { font-weight:bold; color:#777; }
#login { min-height:30em; margin:2em auto 0; border-bottom:1px solid #f8f8f8; background:#eee; }
#login a#showAdvanced { color: #555; }
#login form { width:22em; margin:2em auto 2em; padding:0; }
#login form fieldset { background:0; border:0; margin-bottom:2em; padding:0; }
#login form fieldset legend { font-weight:bold; }
#login form label { position:absolute; margin:.8em .8em; font-size:1.5em; color:#666; }
#login form label { margin:.9em .8em .7em;; color:#666; }
/* NEEDED FOR INFIELD LABELS */
p.infield { position: relative; }
label.infield { cursor: text !important; }
#login form label.infield { position:absolute; font-size:1.5em; color:#AAA; }
#login #dbhostlabel, #login #directorylabel { display:block; margin:.95em 0 .8em -8em; }
#login form input[type="checkbox"]+label { position:relative; margin:0; font-size:1em; text-shadow:#fff 0 1px 0; }
#login form ul.errors { background:#fed7d7; border:1px solid #f00; list-style-indent:inside; margin:0 0 2em; padding:1em; }
@ -96,13 +98,14 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text-
/* VARIOUS REUSABLE SELECTORS */
.hidden { display:none; }
.bold { font-weight: bold; }
#notification { z-index:101; cursor:pointer; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; }
.action, .selectedActions a, #logout { opacity:.3; -webkit-transition:opacity 500ms; -moz-transition:opacity 500ms; -o-transition:opacity 500ms; transition:opacity 500ms; }
.action:hover, .selectedActions a:hover, #logout:hover { opacity:1; }
table tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
table:not(.nostyle) tr { -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; }
tbody tr:hover, tr:active { background-color:#f8f8f8; }
#body-settings .personalblock, #body-settings .helpblock { padding:.5em 1em; margin:1em; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

12
core/js/jquery.infieldlabel.min.js vendored Executable file
View File

@ -0,0 +1,12 @@
/*
* In-Field Label jQuery Plugin
* http://fuelyourcoding.com/scripts/infield.html
*
* Copyright (c) 2009 Doug Neiner
* Dual licensed under the MIT and GPL licenses.
* Uses the same license as jQuery, see:
* http://docs.jquery.com/License
*
* @version 0.1
*/
(function($){$.InFieldLabels=function(b,c,d){var f=this;f.$label=$(b);f.label=b;f.$field=$(c);f.field=c;f.$label.data("InFieldLabels",f);f.showing=true;f.init=function(){f.options=$.extend({},$.InFieldLabels.defaultOptions,d);if(f.$field.val()!=""){f.$label.hide();f.showing=false};f.$field.focus(function(){f.fadeOnFocus()}).blur(function(){f.checkForEmpty(true)}).bind('keydown.infieldlabel',function(e){f.hideOnChange(e)}).change(function(e){f.checkForEmpty()}).bind('onPropertyChange',function(){f.checkForEmpty()})};f.fadeOnFocus=function(){if(f.showing){f.setOpacity(f.options.fadeOpacity)}};f.setOpacity=function(a){f.$label.stop().animate({opacity:a},f.options.fadeDuration);f.showing=(a>0.0)};f.checkForEmpty=function(a){if(f.$field.val()==""){f.prepForShow();f.setOpacity(a?1.0:f.options.fadeOpacity)}else{f.setOpacity(0.0)}};f.prepForShow=function(e){if(!f.showing){f.$label.css({opacity:0.0}).show();f.$field.bind('keydown.infieldlabel',function(e){f.hideOnChange(e)})}};f.hideOnChange=function(e){if((e.keyCode==16)||(e.keyCode==9))return;if(f.showing){f.$label.hide();f.showing=false};f.$field.unbind('keydown.infieldlabel')};f.init()};$.InFieldLabels.defaultOptions={fadeOpacity:0.5,fadeDuration:300};$.fn.inFieldLabels=function(c){return this.each(function(){var a=$(this).attr('for');if(!a)return;var b=$("input#"+a+"[type='text'],"+"input#"+a+"[type='password'],"+"textarea#"+a);if(b.length==0)return;(new $.InFieldLabels(this,b[0],c))})}})(jQuery);

View File

@ -244,7 +244,36 @@ function object(o) {
return new F();
}
/**
* Fills height of window. (more precise than height: 100%;)
*/
function fillHeight(selector) {
var height = parseFloat($(window).height())-parseFloat(selector.css('top'));
selector.css('height', height + 'px');
if(selector.outerHeight() > selector.height())
selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px');
}
/**
* Fills height and width of window. (more precise than height: 100%; or width: 100%;)
*/
function fillWindow(selector) {
fillHeight(selector);
var width = parseFloat($(window).width())-parseFloat(selector.css('left'));
selector.css('width', width + 'px');
if(selector.outerWidth() > selector.width())
selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px');
}
$(document).ready(function(){
$(window).resize(function () {
fillHeight($('#leftcontent'));
fillWindow($('#rightcontent'));
});
$(window).trigger('resize');
if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg
replaceSVG();
}else{
@ -252,7 +281,7 @@ $(document).ready(function(){
}
$('form.searchbox').submit(function(event){
event.preventDefault();
})
});
$('#searchbox').keyup(function(event){
if(event.keyCode==13){//enter
if(OC.search.currentResult>-1){
@ -290,7 +319,9 @@ $(document).ready(function(){
// 'show password' checkbox
$('#pass2').showPassword();
/* @TODO: Currently not working perfect. Remember-Checkbox is flashing.
//use infield labels
$("label.infield").inFieldLabels();
// hide log in button etc. when form fields not filled
$('#submit').hide();
$('#remember_login').hide();
@ -302,18 +333,16 @@ $(document).ready(function(){
empty = true;
}
});
if(empty) {
$('#submit').fadeOut();
$('#remember_login').fadeOut();
$('#remember_login').hide();
$('#remember_login+label').fadeOut();
} else {
$('#submit').fadeIn();
$('#remember_login').fadeIn();
$('#remember_login').show();
$('#remember_login+label').fadeIn();
}
});
*/
if($('body').attr("id")=="body-user") { $('#settings #expanddiv').hide(); }
$('#settings #expand').click(function(event) {
@ -322,7 +351,7 @@ $(document).ready(function(){
});
$('#settings #expanddiv').click(function(event){
event.stopPropagation();
})
});
$('#settings #expand').hover(function(){
$('#settings #expand+span').fadeToggle();
});

View File

@ -43,25 +43,25 @@
});
button.addClass('active');
event.stopPropagation();
var options=$(this).parent().next().children().map(function(){return $(this).val()});
var options=$(this).parent().next().children().map(function(){return $(this).val();});
var list=$('<ul class="multiselectoptions"/>').hide().appendTo($(this).parent());
function createItem(item,checked){
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked','checked');
input.attr('checked',true);
}
if(checked){
settings.checked.push(item);
}
input.change(function(){
var groupname=$(this).next().text();
if($(this).attr('checked')){
if($(this).is(':checked')){
settings.checked.push(groupname);
if(settings.oncheck){
if(settings.oncheck(groupname)===false){
$(this).removeAttr('checked');
$(this).attr('checked', false);
return;
}
}
@ -70,7 +70,7 @@
settings.checked.splice(index,1);
if(settings.onuncheck){
if(settings.onuncheck(groupname)===false){
$(this).attr('checked','checked');
$(this).attr('checked',true);
return;
}
}
@ -81,7 +81,7 @@
}else{
button.children('span').first().text(settings.title);
}
var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px'
var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px';
var newWidth=Math.max(button.width(),settings.minWidth);
button.css('height',button.height());
button.css('white-space','nowrap');

View File

@ -1,6 +1,7 @@
$(document).ready(function() {
$('#selectDbType').buttonset();
$('#datadirContent').hide(250);
$('#databaseField').hide(250);
if($('#hasSQLite').val()=='true'){
$('#use_other_db').hide();
$('#dbhost').hide();
@ -29,6 +30,7 @@ $(document).ready(function() {
$('#showAdvanced').click(function() {
$('#datadirContent').slideToggle(250);
$('#databaseField').slideToggle(250);
});
$("form").submit(function(){
// Save form parameters

View File

@ -7,7 +7,7 @@
*/
$RUNTIME_NOAPPS = TRUE; //no apps
require_once('../lib/base.php');
require_once('../../lib/base.php');
// Someone lost their password:
if (isset($_POST['user'])) {
@ -16,17 +16,17 @@ if (isset($_POST['user'])) {
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
$email = OC_Preferences::getValue($_POST['user'], 'lostpassword', 'email', '');
if (!empty($email)) {
$link = OC_Helper::linkTo('lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
$tmpl = new OC_Template('lostpassword', 'email');
$link = OC_Helper::linkTo('core/lostpassword', 'resetpassword.php', null, true).'?user='.$_POST['user'].'&token='.$token;
$tmpl = new OC_Template('core/lostpassword', 'email');
$tmpl->assign('link', $link);
$msg = $tmpl->fetchPage();
$l = new OC_L10N('core');
mail($email, $l->t('Owncloud password reset'), $msg);
}
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true));
} else {
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false));
}
} else {
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
}

View File

@ -7,21 +7,21 @@
*/
$RUNTIME_NOAPPS = TRUE; //no apps
require_once('../lib/base.php');
require_once('../../lib/base.php');
// Someone wants to reset their password:
if(isset($_GET['token']) && isset($_GET['user']) && OC_Preferences::getValue($_GET['user'], 'owncloud', 'lostpassword') === $_GET['token']) {
if (isset($_POST['password'])) {
if (OC_User::setPassword($_GET['user'], $_POST['password'])) {
OC_Preferences::deleteKey($_GET['user'], 'owncloud', 'lostpassword');
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => true));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => true));
} else {
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
}
} else {
OC_Template::printGuestPage('lostpassword', 'resetpassword', array('success' => false));
OC_Template::printGuestPage('core/lostpassword', 'resetpassword', array('success' => false));
}
} else {
// Someone lost their password
OC_Template::printGuestPage('lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => false));
}

View File

@ -7,7 +7,10 @@
<?php if ($_['error']): ?>
<?php echo $l->t('Login failed!'); ?>
<?php endif; ?>
<input type="text" name="user" id="user" placeholder="<?php echo $l->t('Username'); ?>" value="" autocomplete="off" required autofocus />
<p class="infield">
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
<input type="text" name="user" id="user" value="" autocomplete="off" required autofocus />
</p>
<input type="submit" id="submit" value="<?php echo $l->t('Request reset'); ?>" />
<?php endif; ?>
</fieldset>

View File

@ -4,7 +4,10 @@
<h1><?php echo $l->t('Your password was reset'); ?></h1>
<p><a href="<?php echo OC::$WEBROOT ?>/"><?php echo $l->t('To login page'); ?></a></p>
<?php else: ?>
<input type="password" name="password" id="password" placeholder="<?php echo $l->t('New password'); ?>" value="" required />
<p class="infield">
<label for="password" class="infield"><?php echo $l->t( 'New password' ); ?></label>
<input type="password" name="password" id="password" value="" required />
</p>
<input type="submit" id="submit" value="<?php echo $l->t('Reset password'); ?>" />
<?php endif; ?>
</fieldset>

View File

@ -18,10 +18,24 @@
<fieldset>
<legend><?php echo $l->t( 'Create an <strong>admin account</strong>' ); ?></legend>
<input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" placeholder="<?php echo $l->t( 'Username' ); ?>" autocomplete="off" autofocus required />
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" placeholder="<?php echo $l->t( 'Password' ); ?>" required />
<p class="infield">
<label for="adminlogin" class="infield"><?php echo $l->t( 'Username' ); ?></label>
<input type="text" name="adminlogin" id="adminlogin" value="<?php print OC_Helper::init_var('adminlogin'); ?>" autocomplete="off" autofocus required />
</p>
<p class="infield">
<label for="adminpass" class="infield"><?php echo $l->t( 'Password' ); ?></label>
<input type="password" name="adminpass" id="adminpass" value="<?php print OC_Helper::init_var('adminpass'); ?>" required />
</p>
</fieldset>
<fieldset id="datadirField">
<legend><a id="showAdvanced"><?php echo $l->t( 'Advanced' ); ?> ▾</a></legend>
<div id="datadirContent">
<label for="directory"><?php echo $l->t( 'Data folder' ); ?>:</label><br/>
<input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" />
</div>
</fieldset>
<fieldset id='databaseField'>
<?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; //other than SQLite ?>
<legend><?php echo $l->t( 'Configure the database' ); ?></legend>
@ -61,20 +75,24 @@
<?php if($hasOtherDB): ?>
<div id="use_other_db">
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" placeholder="<?php echo $l->t( 'Database user' ); ?>" autocomplete="off" />
<input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" placeholder="<?php echo $l->t( 'Database password' ); ?>" />
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" placeholder="<?php echo $l->t( 'Database name' ); ?>" autocomplete="off" />
<p class="infield">
<label for="dbuser" class="infield"><?php echo $l->t( 'Database user' ); ?></label>
<input type="text" name="dbuser" id="dbuser" value="<?php print OC_Helper::init_var('dbuser'); ?>" autocomplete="off" />
</p>
<p class="infield">
<label for="dbpass" class="infield"><?php echo $l->t( 'Database password' ); ?></label>
<input type="password" name="dbpass" id="dbpass" value="<?php print OC_Helper::init_var('dbpass'); ?>" />
</p>
<p class="infield">
<label for="dbname" class="infield"><?php echo $l->t( 'Database name' ); ?></label>
<input type="text" name="dbname" id="dbname" value="<?php print OC_Helper::init_var('dbname'); ?>" autocomplete="off" />
</p>
</div>
<?php endif; ?>
</fieldset>
<fieldset id="datadirField">
<legend><a id="showAdvanced"><?php echo $l->t( 'Advanced' ); ?> ▾</a></legend>
<div id="datadirContent">
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" placeholder="<?php echo $l->t( 'Database host' ); ?>" />
<input type="text" name="directory" id="directory" value="<?php print OC_Helper::init_var('directory', $_['directory']); ?>" placeholder="<?php echo $l->t( 'Data folder' ); ?>" />
</div>
<p class="infield">
<label for="dbhost" class="infield"><?php echo $l->t( 'Database host' ); ?></label>
<input type="text" name="dbhost" id="dbhost" value="<?php print OC_Helper::init_var('dbhost', 'localhost'); ?>" />
</p>
</fieldset>
<div class="buttons"><input type="submit" value="<?php echo $l->t( 'Finish setup' ); ?>" /></div>

View File

@ -1,10 +1,17 @@
<form action="index.php" method="post">
<fieldset>
<?php if(!empty($_['redirect'])) { echo '<input type="hidden" name="redirect_url" value="'.$_['redirect'].'" />'; } ?>
<?php if($_['error']): ?>
<a href="./lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
<a href="./core/lostpassword/"><?php echo $l->t('Lost your password?'); ?></a>
<?php endif; ?>
<input type="text" name="user" id="user" placeholder="<?php echo $l->t( 'Username' ); ?>" value="<?php echo !empty($_POST['user'])?$_POST['user'].'"':'" autofocus'; ?> autocomplete="off" required />
<input type="password" name="password" id="password" placeholder="<?php echo $l->t( 'Password' ); ?>" value="" required <?php echo !empty($_POST['user'])?'autofocus':''; ?> />
<p class="infield">
<label for="user" class="infield"><?php echo $l->t( 'Username' ); ?></label>
<input type="text" name="user" id="user" value="<?php echo !empty($_POST['user'])?$_POST['user'].'"':'" autofocus'; ?> autocomplete="off" required />
</p>
<p class="infield">
<label for="password" class="infield"><?php echo $l->t( 'Password' ); ?></label>
<input type="password" name="password" id="password" value="" required <?php echo !empty($_POST['user'])?'autofocus':''; ?> />
</p>
<input type="checkbox" name="remember_login" value="1" id="remember_login" /><label for="remember_login"><?php echo $l->t('remember'); ?></label>
<input type="submit" id="submit" class="login" value="<?php echo $l->t( 'Log in' ); ?>" />
</fieldset>

View File

@ -68,6 +68,9 @@ else {
OC_User::setUserId($_COOKIE['oc_username']);
OC_Util::redirectToDefaultPage();
}
else {
OC_User::unsetMagicInCookie();
}
}
// Someone wants to log in :
@ -90,5 +93,5 @@ else {
}
}
OC_Template::printGuestPage('', 'login', array('error' => $error ));
OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' ));
}

View File

@ -115,6 +115,7 @@ class OC{
OC_Util::addScript( "jquery-1.6.4.min" );
OC_Util::addScript( "jquery-ui-1.8.14.custom.min" );
OC_Util::addScript( "jquery-showpassword" );
OC_Util::addScript( "jquery.infieldlabel.min" );
OC_Util::addScript( "jquery-tipsy" );
OC_Util::addScript( "js" );
//OC_Util::addScript( "multiselect" );

View File

@ -61,7 +61,7 @@ class OC_Helper {
}
if($redirect_url)
return $urlLinkTo.'?redirect_url='.$redirect_url;
return $urlLinkTo.'?redirect_url='.urlencode($_SERVER["REQUEST_URI"]);
else
return $urlLinkTo;

View File

@ -32,6 +32,8 @@ return array(
'gz'=>'application/x-gzip',
'html'=>'text/html',
'htm'=>'text/html',
'ics'=>'text/calendar',
'ical'=>'text/calendar',
'jpeg'=>'image/jpeg',
'jpg'=>'image/jpeg',
'js'=>'application/javascript',

View File

@ -321,7 +321,11 @@ class OC_Util {
* Redirect to the user default page
*/
public static function redirectToDefaultPage(){
header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php'));
if(isset($_REQUEST['redirect_url'])) {
header( 'Location: '.$_REQUEST['redirect_url']);
} else {
header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', 'files/index.php'));
}
exit();
}
}

View File

@ -9,11 +9,13 @@ input#identity { width:20em; }
.msg.success{ color:#fff; background-color:#0f0; padding:3px; text-shadow:1px 1px #000; }
.msg.error{ color:#fff; background-color:#f00; padding:3px; text-shadow:1px 1px #000; }
table.nostyle label { margin-right: 2em; }
table.nostyle td { padding: 0.2em 0; }
/* USERS */
form { display:inline; }
table th { height:2em; color:#999; }
table th, table td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
table:not(.nostyle) th { height:2em; color:#999; }
table:not(.nostyle) th, table:not(.nostyle) td { border-bottom:1px solid #ddd; padding:0 .5em; padding-left:.8em; text-align:left; font-weight:normal; }
td.name, td.password { padding-left:.8em; }
td.password>img, td.remove>img, td.quota>img { visibility:hidden; }
td.password, td.quota { width:12em; cursor:pointer; }
@ -24,8 +26,8 @@ tr:hover>td.password>span { margin:0; cursor:pointer; }
tr:hover>td.remove>img, tr:hover>td.password>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; }
tr:hover>td.remove>img { float:right; }
li.selected { background-color:#ddd; }
#content>table { margin-top:6.5em; }
table { width:100%; }
#content>table:not(.nostyle) { margin-top:6.5em; }
table:not(.nostyle) { width:100%; }
/* APPS */

View File

@ -7,7 +7,7 @@
$(document).ready(function(){
function applyMultiplySelect(element){
var checked=[];
var user=element.data('username')
var user=element.data('username');
if(element.data('userGroups')){
checked=element.data('userGroups').split(', ');
}
@ -24,7 +24,7 @@ $(document).ready(function(){
},
function(){}
);
}
};
}else{
checkHandeler=false;
}
@ -88,7 +88,6 @@ $(document).ready(function(){
var uid=img.parent().parent().data('uid');
var input=$('<input>');
var quota=img.parent().children('span').text();
img
if(quota=='None'){
quota='';
}

View File

@ -9,9 +9,11 @@ require_once('../lib/base.php');
OC_Util::checkLoggedIn();
// Highlight navigation entry
OC_Util::addScript( "settings", "personal" );
OC_Util::addStyle( "settings", "settings" );
OC_App::setActiveNavigationEntry( "personal" );
OC_Util::addScript( 'settings', 'personal' );
OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'personal' );
// calculate the disc space
$used=OC_Filesystem::filesize('/');
@ -33,7 +35,7 @@ foreach($languageCodes as $lang){
}
// Return template
$tmpl = new OC_Template( "settings", "personal", "user");
$tmpl = new OC_Template( 'settings', 'personal', 'user');
$tmpl->assign('usage',OC_Helper::humanFileSize($used));
$tmpl->assign('total_space',OC_Helper::humanFileSize($total));
$tmpl->assign('usage_relative',$relative);

View File

@ -8,8 +8,8 @@
require_once('../lib/base.php');
OC_Util::checkLoggedIn();
OC_Util::addStyle( "settings", "settings" );
OC_App::setActiveNavigationEntry( "settings" );
OC_Util::addStyle( 'settings', 'settings' );
OC_App::setActiveNavigationEntry( 'settings' );
$tmpl = new OC_Template( 'settings', 'settings', 'user');
$forms=OC_App::getForms('settings');

View File

@ -12,8 +12,6 @@ OC_Util::checkAdminUser();
OC_Util::addScript( 'settings', 'users' );
OC_Util::addScript( 'core', 'multiselect' );
OC_Util::addStyle( 'settings', 'settings' );
OC_Util::addScript( '3rdparty', 'chosen/chosen.jquery.min' );
OC_Util::addStyle( '3rdparty', 'chosen' );
OC_App::setActiveNavigationEntry( 'core_users' );
$users = array();