Beispiel #1
0
p($l->t('Furthermore please note that many sites these days disallow iframing due to security reasons.'));
?>
</em>
			<br>
			<em><?php 
p($l->t('We highly recommend to test the configured sites below properly.'));
?>
</em>
		</p>
		<ul class="external_sites">

		<?php 
$sites = \OCA\External\External::getSites();
for ($i = 0; $i < sizeof($sites); $i++) {
    print_unescaped('<li><input type="text" name="site_name[]" class="site_name" value="' . OCP\Util::sanitizeHTML($sites[$i][0]) . '" placeholder="' . $l->t('Name') . '" />
			<input type="text" class="site_url" name="site_url[]"  value="' . OCP\Util::sanitizeHTML($sites[$i][1]) . '"  placeholder="' . $l->t('URL') . '" />
			<img class="svg action delete_button" src="' . OCP\image_path("", "actions/delete.svg") . '" title="' . $l->t("Remove site") . '" />
			</li>');
}
?>

		</ul>

        <input type="button" id="add_external_site" value="<?php 
p($l->t("Add"));
?>
" />
		<span class="msg"></span>
	</fieldset>
</form>
Beispiel #2
0
 /**
  * scan a file for music
  * @param string $path
  * @return boolean
  */
 public static function scanFile($path)
 {
     if (!self::isMusic($path)) {
         return;
     }
     if (!self::$getID3) {
         self::$getID3 = @new getID3();
         self::$getID3->encoding = 'UTF-8';
     }
     $file = OC_Filesystem::getLocalFile($path);
     $data = @self::$getID3->analyze($file);
     getid3_lib::CopyTagsToComments($data);
     if (!isset($data['comments'])) {
         OCP\Util::writeLog('media', "error reading id3 tags in '{$file}'", OCP\Util::WARN);
         return;
     }
     if (!isset($data['comments']['artist'])) {
         OCP\Util::writeLog('media', "error reading artist tag in '{$file}'", OCP\Util::WARN);
         $artist = 'unknown';
     } else {
         $artist = OCP\Util::sanitizeHTML(stripslashes($data['comments']['artist'][0]));
     }
     if (!isset($data['comments']['album'])) {
         OCP\Util::writeLog('media', "error reading album tag in '{$file}'", OCP\Util::WARN);
         $album = 'unknown';
     } else {
         $album = OCP\Util::sanitizeHTML(stripslashes($data['comments']['album'][0]));
     }
     if (!isset($data['comments']['title'])) {
         OCP\Util::writeLog('media', "error reading title tag in '{$file}'", OCP\Util::WARN);
         $title = 'unknown';
     } else {
         $title = OCP\Util::sanitizeHTML(stripslashes($data['comments']['title'][0]));
     }
     $size = $data['filesize'];
     if (isset($data['comments']['track'])) {
         $track = $data['comments']['track'][0];
     } else {
         if (isset($data['comments']['track_number'])) {
             $track = $data['comments']['track_number'][0];
             $track = explode('/', $track);
             $track = $track[0];
         } else {
             $track = 0;
         }
     }
     $length = isset($data['playtime_seconds']) ? round($data['playtime_seconds']) : 0;
     if (!isset(self::$artists[$artist])) {
         $artistId = OC_MEDIA_COLLECTION::addArtist($artist);
         self::$artists[$artist] = $artistId;
     } else {
         $artistId = self::$artists[$artist];
     }
     if (!isset(self::$albums[$artist . '/' . $album])) {
         $albumId = OC_MEDIA_COLLECTION::addAlbum($album, $artistId);
         self::$albums[$artist . '/' . $album] = $albumId;
     } else {
         $albumId = self::$albums[$artist . '/' . $album];
     }
     $songId = OC_MEDIA_COLLECTION::addSong($title, $path, $artistId, $albumId, $length, $track, $size);
     return !($title == 'unknown' && $artist == 'unknown' && $album == 'unknown') ? $songId : 0;
 }
Beispiel #3
0
		<input type="hidden" id="calendar_import_progresskey" value="<?php 
p(rand());
?>
">
		<input type="hidden" id="calendar_import_availablename" value="<?php 
p($newcalendarname);
?>
">
		<div id="calendar_import_form_message"><?php 
p($l->t('Please choose a calendar'));
?>
</div>
		<select style="width:100%;" id="calendar_import_calendar" name="calendar_import_calendar">
		<?php 
for ($i = 0; $i < count($calendar_options); $i++) {
    $calendar_options[$i]['displayname'] = OCP\Util::sanitizeHTML($calendar_options[$i]['displayname']);
}
print_unescaped(OCP\html_select_options($calendar_options, $calendar_options[0]['id'], array('value' => 'id', 'label' => 'displayname')));
?>
		</select>
		<br><br>
		<div id="calendar_import_newcalform">
			<input id="calendar_import_newcalendar_color" class="color-picker" type="hidden" value="<?php 
p(substr($calendarcolor, 1));
?>
">
			<input id="calendar_import_newcalendar"  class="" type="text" placeholder="<?php 
p($l->t('Name of new calendar'));
?>
" value="<?php 
p($guessedcalendarname);
Beispiel #4
0
	<?php 
for ($i = 0; $i < count($_["breadcrumb"]); $i++) {
    $crumb = $_["breadcrumb"][$i];
    $dir = str_replace('+', '%20', urlencode($crumb["dir"]));
    ?>
		<div class="crumb <?php 
    if ($i == count($_["breadcrumb"]) - 1) {
        echo 'last';
    }
    ?>
 svg"
			 data-dir='<?php 
    echo $dir;
    ?>
'
			 style='background-image:url("<?php 
    echo OCP\image_path('core', 'breadcrumb.png');
    ?>
")'>
		<a href="<?php 
    echo $_['baseURL'] . $dir;
    ?>
"><?php 
    echo OCP\Util::sanitizeHTML($crumb["name"]);
    ?>
</a>
		</div>
	<?php 
}
Beispiel #5
0
<?php

/**
 * Copyright (c) 2011, 2012 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 'when/When.php';
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('calendar');
session_write_close();
// Look for the calendar id
$calendar_id = OC_Calendar_App::getCalendar($_GET['calendar_id'], false, false);
if ($calendar_id !== false) {
    if (!is_numeric($calendar_id['userid']) && $calendar_id['userid'] != OCP\User::getUser()) {
        OCP\JSON::error();
        exit;
    }
} else {
    $calendar_id = $_GET['calendar_id'];
}
$start = version_compare(PHP_VERSION, '5.3.0', '>=') ? DateTime::createFromFormat('U', $_GET['start']) : new DateTime('@' . $_GET['start']);
$end = version_compare(PHP_VERSION, '5.3.0', '>=') ? DateTime::createFromFormat('U', $_GET['end']) : new DateTime('@' . $_GET['end']);
$events = OC_Calendar_App::getrequestedEvents($_GET['calendar_id'], $start, $end);
$output = array();
foreach ($events as $event) {
    $output = array_merge($output, OC_Calendar_App::generateEventOutput($event, $start, $end));
}
OCP\JSON::encodedPrint(OCP\Util::sanitizeHTML($output));
Beispiel #6
0
p(urlencode(OCP\USER::getUser()));
?>
/" readonly></dd>
		<dt><?php 
p($l->t('Read only iCalendar link(s)'));
?>
</dt>
		<dd>
			<?php 
foreach ($_['calendars'] as $calendar) {
    if ($calendar['userid'] == OCP\USER::getUser()) {
        $uri = rawurlencode(html_entity_decode($calendar['uri'], ENT_QUOTES, 'UTF-8'));
    } else {
        $uri = rawurlencode(html_entity_decode($calendar['uri'], ENT_QUOTES, 'UTF-8')) . '_shared_by_' . $calendar['userid'];
    }
    ?>
			<a href="<?php 
    p(OCP\Util::linkToRemote('caldav') . 'calendars/' . urlencode(OCP\USER::getUser()) . '/' . urlencode($uri));
    ?>
?export" class="link"><?php 
    p(OCP\Util::sanitizeHTML($calendar['displayname']));
    ?>
</a><br />
			<?php 
}
?>
		</dd>
		</dl>
	</div>
</div>
Beispiel #7
0
<?php

/**
 * Copyright (c) 2011 Marvin Thomas Rabe <*****@*****.**>
 * Copyright (c) 2011 Arthur Schiwon <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
?>
<input type="hidden" id="bookmarkFilterTag" value="<?php 
if (isset($_GET['tag'])) {
    echo OCP\Util::sanitizeHTML($_GET['tag']);
}
?>
" />
<div id="controls">
	<input type="hidden" id="bookmark_add_id" value="0" />
	<input type="text" id="bookmark_add_url" placeholder="<?php 
echo $l->t('Address');
?>
" class="bookmarks_input" />
	<input type="text" id="bookmark_add_title" placeholder="<?php 
echo $l->t('Title');
?>
" class="bookmarks_input" />
	<input type="text" id="bookmark_add_tags" placeholder="<?php 
echo $l->t('Tags');
?>
" class="bookmarks_input" />
	<input type="submit" value="<?php 
Beispiel #8
0
		$("a[rel=images]").fancybox({
			'titlePosition': 'inside'
		});
});

</script>

<div id="controls"><?php 
$sr = trim($_['root'], '/');
if (!empty($sr)) {
    $paths = explode('/', $sr);
    $path = '/';
    for ($i = 0; $i < count($paths); $i++) {
        $path .= urlencode($paths[$i]) . '/';
        $classess = 'crumb' . ($i == count($paths) - 1 ? ' last' : '');
        echo '<div class="' . $classess . '" style="background-image:url(\'' . \OCP\image_path('core', 'breadcrumb.png') . '\')"><a href="' . \OCP\Util::linkTo('gallery', 'index.php') . '&root=' . $path . '">' . OCP\Util::sanitizeHTML($paths[$i]) . '</a></div>';
    }
}
?>
	<div id="slideshow">
		<input type="button" class="start" value="<?php 
echo $l->t('Slideshow');
?>
" />
	</div>
</div>
<div id="gallerycontent">
<?php 
session_write_close();
echo $_['tl']->get();
?>
Beispiel #9
0
    $bFile = false;
} else {
    if ($_['filename'] != '') {
        $file = \OC\Files\Filesystem::file_get_contents($_['path'] . '/' . $_['filename']);
        $bFile = true;
    }
}
if (!$bFile && $_['isSub'] === 'false') {
    OCP\JSON::error(array('error' => '404'));
}
if ($bFile) {
    $import = new OCA\CalendarPlus\Import($file);
    $import->setUserID(OCP\User::getUser());
    $newcalendarname = OCP\Util::sanitizeHTML($import->createCalendarName());
    $guessedcalendarname = OCP\Util::sanitizeHTML($import->guessCalendarName());
    $calendarcolor = OCP\Util::sanitizeHTML($import->createCalendarColor());
}
//loading calendars for select box
$calendar_options = OCA\CalendarPlus\Calendar::allCalendars(OCP\USER::getUser());
?>
<div id="calendar_import_dialog" title="<?php 
p($l->t("Import a calendar file"));
?>
">
<div class="importdiv">
	<input id="calendar_import_url"  type="text" placeholder="<?php 
p($l->t('Url to subscribed calendar'));
?>
" value="">
	<button id="checkurl" class="icon-checkmark"></button>
	<div id="importmsg"></div>
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library.  If not, see <http://www.gnu.org/licenses/>.
*
*/
require_once 'lib/impress.php';
// Check if we are a user
OCP\User::checkLoggedIn();
OCP\JSON::checkAppEnabled('impress');
$filename = OCP\Util::sanitizeHTML($_GET['file']);
$title = OCP\Util::sanitizeHTML($_GET['name']);
if (!\OC\Files\Filesystem::file_exists($filename)) {
    header("HTTP/1.0 404 Not Found");
    $tmpl = new OCP\Template('', '404', 'guest');
    $tmpl->assign('file', $filename);
    $tmpl->printPage();
    exit;
}
$data = \OC\Files\Filesystem::file_get_contents($filename);
if (stripos($data, '<html') != false or stripos($data, '<head') != false or stripos($data, '<body') != false) {
    echo '<br /><center>This is not a valid impress file. Please check the documentation.</center>';
    exit;
}
if (stripos($data, '<script') != false) {
    echo '<br /><center>Please don\'t use javascript in impress files.</center>';
    exit;
calendar_dialog" title="<?php 
p($_['new'] ? $l->t("New calendar") : $l->t("Edit calendar"));
?>
" colspan="6">
<table width="100%" style="border: 0;">
<tr>
	<th><?php 
p($l->t('Displayname'));
?>
</th>
	<td>
		<input id="displayname_<?php 
p($_['calendar']['id']);
?>
" type="text" value="<?php 
p(OCP\Util::sanitizeHTML($_['calendar']['displayname']));
?>
">
	</td>
</tr>
<?php 
if (!$_['new']) {
}
?>
<tr>
	<th><?php 
p($l->t('Calendar color'));
?>
</th>
	<td>
		<select id="calendarcolor_<?php 
Beispiel #12
0
 function p($string)
 {
     print OCP\Util::sanitizeHTML($string);
 }
Beispiel #13
0
		<input type="hidden" id="contacts_import_progresskey" value="<?php 
p('contacts-import-' . time());
?>
">
		<input type="hidden" id="contacts_import_availablename" value="<?php 
p($newaddressbookname);
?>
">
		<div id="contacts_import_form_message"><?php 
p($l->t('Please choose the addressbook'));
?>
</div>
		<select style="width:98%;" id="contacts_import_addressbook" name="contacts_import_addressbook">
		<?php 
for ($i = 0; $i < count($contacts_options); $i++) {
    $addressbookChoose[] = array('id' => $contacts_options[$i]['id'], 'displayname' => OCP\Util::sanitizeHTML($contacts_options[$i]['displayname']));
}
$addressbookChoose[] = array('id' => 'newaddressbook', 'displayname' => $l->t('create a new addressbook'));
print_unescaped(OCP\html_select_options($addressbookChoose, $addressbookChoose[0]['id'], array('value' => 'id', 'label' => 'displayname')));
?>
		</select>
		<br><br>
		<div id="contacts_import_newaddrform">
			<input id="contacts_import_newaddressbook"  class="" type="text" placeholder="<?php 
p($l->t('Name of new Addressbook'));
?>
" value="<?php 
p($guessedaddressbookname);
?>
"><br>
			
    echo '<ul>';
    foreach ($_['categories'] as $categorie) {
        echo '<li>' . $categorie . '</li>';
    }
    echo '</ul>';
}
?>
			</td>
			<th width="75px">&nbsp;&nbsp;&nbsp;<?php 
echo $l->t("Calendar");
?>
:</th>
			<td>
			<?php 
$calendar = OC_Calendar_App::getCalendar($_['calendar'], false, false);
echo OCP\Util::sanitizeHTML($calendar['displayname']) . ' ' . $l->t('of') . ' ' . $calendar['userid'];
?>
			</td>
			<th width="75px">&nbsp;</th>
			<td>
				<input type="hidden" name="calendar" value="<?php 
echo $_['calendar_options'][0]['id'];
?>
">
			</td>
		</tr>
	</table>
	<hr>
	<table width="100%">
		<tr>
			<th width="75px"></th>
Beispiel #15
0
    } catch (Sabre\VObject\ParseException $e) {
        try {
            $vcard = Sabre\VObject\Reader::read($part, Sabre\VObject\Reader::OPTION_IGNORE_INVALID_LINES);
            $partial += 1;
            OCP\Util::writeLog('contacts', 'Import: Retrying reading card. Error parsing VCard: ' . $e->getMessage(), OCP\Util::ERROR);
        } catch (Exception $e) {
            $failed += 1;
            OCP\Util::writeLog('contacts', 'Import: skipping card. Error parsing VCard: ' . $e->getMessage(), OCP\Util::ERROR);
            continue;
            // Ditch cards that can't be parsed by Sabre.
        }
    }
    try {
        OCA\Contacts\VCard::add($id, $vcard);
        $imported += 1;
    } catch (Exception $e) {
        OCP\Util::writeLog('contacts', 'Error importing vcard: ' . $e->getMessage() . $nl . $vcard, OCP\Util::ERROR);
        $failed += 1;
    }
}
//done the import
writeProgress('100');
sleep(3);
OC_Cache::remove($progresskey);
if (isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') {
    if (!$view->unlink('/imports/' . $inputfile)) {
        OCP\Util::writeLog('contacts', 'Import: Error unlinking OC_FilesystemView ' . '/' . $inputfile, OCP\Util::ERROR);
    }
}
OCP\JSON::success(array('data' => array('imported' => $imported, 'failed' => $failed, 'file' => OCP\Util::sanitizeHTML($inputfile))));