User Tools

Site Tools


lmce_owncloud

LinuxMCE ownCloud automatic Setup + Authentication

This is about to install ownCloud on LinuxMCE and authenticate against pluto_main database!
  1. Download the script: owncloud_setup.sh
  2. make it executable: chmod +x owncloud_setup.sh
  3. run it ./owncloud_setup.sh
  4. When finished owncloud will be located in “/var/www/userspace/”. Setup happens automatically
  5. Download and unzip user_lmce.zip. Move the folder to “/var/www/userspace/apps/”

:!: On the first run ownCloud will setup the database and admin user.

Default admin is:

Username: linuxmce
Password: linuxmce

The script

wget http://svn.linuxmce.org/svn/people/ochorocho/owncloud/owncloud_setup.sh

The Auth app

Basically a modification of usr_sql app by Andreas Böhler

LinuxMCE auth app

vlc -vvv file:///mnt/device/61/sadasdasd.avi --sout="#transcode{vcodec=theo, vb=800, acodec=vorb, ab=128, scale=1, audio-sync, width=480, height=320}:std{access=http, mux=ogg, dst='192.168.1.210:9080/streaming/test/106.ogg' }"

Useful code for app development

PHP

Add Settings in admin area (appinfo/app.php):

\OCP\App::registerAdmin('lmce_vdr', 'admin/settings');

Get users ID:

OCP\User::getUser();

Translate in Template

<?php echo $l->t('Channel manager'); ?>

Check for logged in user:

OCP\JSON::checkLoggedIn();

Check for enabled app:

OCP\JSON::checkAppEnabled('lmce_vdr');

Javascript

Include JS (appinfo/app.php):

OCP\Util::addscript('lmce_vdr','script');

Includes file app_folder/js/script.js

Translate:

t('appname','text to translate');

Select a File:

OC.dialogs.filepicker('test', function(val) {console.log(val)}, true, null, true);

AJAX URL:

OC.filePath('lmce_vdr','ajax','moveChannel.php'),

Example AJAX request:

$.ajax({
	// REQUEST URL
	url: OC.filePath('lmce_vdr','ajax','action.php'),
	type: "post",
	// URL PARAMS
	data: { action: action},
	success: function(data){
		// DO SOMETHING WITH data
	},
	error: function(data){
		alert('Error running action ...');
	},
});

CSS

Include CSS (appinfo/app.php):

OCP\Util::addStyle("lmce_vdr", "style");

Includes file app_folder/css/style.css

Get file app folder using %appswebroot%:

#someId {
  background:url(%appswebroot%/lmce_vdr/img/textfield-rename.png)
}

Good to know vars in JS:

0
oc_debug=false;
oc_webroot="/userspace";
oc_appswebroots={"files":"/userspace/apps/files","activity":"/userspace/apps/activity","calendar":"/userspace/apps/calendar","contacts":"/userspace/apps/contacts"}datepickerFormatDate="dd.mm.yy";
dayNames=["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"];
var monthNames=["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
var firstDay=0;
var oc_config={"session_lifetime":"144000","session_keepalive":true};
lmce_owncloud.txt · Last modified: 2014/06/10 13:47 by admin