This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lmce_owncloud [2014/05/23 00:52] – [The Auth app] admin | lmce_owncloud [2014/06/10 13:47] (current) – admin | ||
---|---|---|---|
Line 21: | Line 21: | ||
===== The script ===== | ===== The script ===== | ||
- | <code bash owncloud_setup.sh> | + | wget http://svn.linuxmce.org/svn/people/ |
- | #!/bin/bash | + | |
- | ### PREDEFINE VARS | + | ===== The Auth app ===== |
- | INSTALL=/var/www/ | + | |
- | DOWNLOAD=owncloud-6.0.3.zip | + | |
- | DBNAME=lmce_userspace | + | |
- | if test " | + | Basically a modification of usr_sql app by Andreas Böhler |
- | then | + | |
- | # INSTALL PACKAGES | + | {{:: |
- | apt-get install php5-gd php-xml-parser php5-intl php5-curl | + | |
- | rm -Rf / | ||
- | |||
- | cd /tmp/ && | ||
- | unzip / | ||
- | # PREPARE OWNCLOUD | + | vlc -vvv file:///mnt/device/ |
- | # cd /tmp/owncloud/config/ && cp config.sample.php config_write.php | + | |
- | echo '<? | + | ===== Useful code for app development ===== |
- | + | ==== PHP ==== | |
- | $AUTOCONFIG | + | |
- | "dbtype" | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | " | + | |
- | ); | + | |
- | + | ||
- | ' > / | + | |
- | mysql -u root mysql -e " | + | Add Settings in admin area (appinfo/app.php): |
- | + | ||
- | # CHECKOUT APPS | + | |
- | svn co http://svn.linuxmce.org/ | + | |
- | svn co http:// | + | |
- | + | ||
- | mv / | + | |
- | mv / | + | |
- | chown -R www-data: | + | |
- | chmod -R 770 ${INSTALL}/ | + | |
- | + | ||
- | rm -Rf / | + | |
- | # MAKE AUTOMATIC SETUP WRITE CONFIG DO MODIFY | + | < |
- | wget --delete-after " | + | \OCP\App:: |
- | sed -i ' | + | </code> |
- | sed -i " | + | |
- | # ENABLE APPs | + | Get users ID: |
- | # user_lmce | + | |
- | mysql -u root ${DBNAME} -e " | + | |
- | # lmceimap | + | |
- | mysql -u root ${DBNAME} -e " | + | |
- | # files_external | + | |
- | mysql -u root ${DBNAME} -e " | + | |
- | elif test " | + | <code php> |
- | then | + | OCP\User:: |
+ | </ | ||
- | # CLEAN UP | + | Translate in Template |
- | rm -Rf ${INSTALL}/ | + | |
- | mysql -u root mysql -e "DROP USER ' | + | |
- | mysql -u root mysql -e "DROP USER ' | + | |
- | mysql -u root mysql -e "DROP DATABASE ${DBNAME};" | + | |
- | elif test " | + | <code php> |
- | then | + | <? |
- | echo 'commands: | + | |
- | setup | + | |
- | delete | + | |
- | | + | |
- | fi | + | |
</ | </ | ||
- | ===== The Auth app ===== | + | Check for logged in user: |
- | Basically a modification of usr_sql app by Andreas Böhler | + | <code php> |
+ | OCP\JSON:: | ||
+ | </ | ||
- | {{:: | + | Check for enabled app: |
+ | <code php> | ||
+ | OCP\JSON:: | ||
+ | </ | ||
+ | ==== Javascript ==== | ||
+ | Include JS (appinfo/ | ||
- | vlc -vvv file:///mnt/device/ | + | <code php> |
+ | OCP\Util:: | ||
+ | </code> | ||
+ | |||
+ | Includes file app_folder/js/script.js | ||
+ | |||
+ | Translate: | ||
+ | |||
+ | <code javascript> | ||
+ | t(' | ||
+ | </code> | ||
+ | |||
+ | Select a File: | ||
+ | |||
+ | <code javascript> | ||
+ | OC.dialogs.filepicker(' | ||
+ | </ | ||
+ | |||
+ | AJAX URL: | ||
+ | |||
+ | <code javascript> | ||
+ | OC.filePath(' | ||
+ | </ | ||
+ | |||
+ | Example AJAX request: | ||
+ | |||
+ | <code javascript> | ||
+ | $.ajax({ | ||
+ | // REQUEST URL | ||
+ | url: OC.filePath(' | ||
+ | type: " | ||
+ | // URL PARAMS | ||
+ | data: { action: action}, | ||
+ | success: function(data){ | ||
+ | // DO SOMETHING WITH data | ||
+ | }, | ||
+ | error: function(data){ | ||
+ | alert('Error running action | ||
+ | }, | ||
+ | }); | ||
+ | </ | ||
+ | |||
+ | ==== CSS ==== | ||
+ | |||
+ | |||
+ | Include CSS (appinfo/ | ||
+ | |||
+ | <code php> | ||
+ | OCP\Util:: | ||
+ | </code> | ||
+ | |||
+ | Includes file app_folder/css/style.css | ||
+ | |||
+ | |||
+ | Get file app folder using **%appswebroot%**: | ||
+ | |||
+ | <code css> | ||
+ | #someId { | ||
+ | background: | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Good to know vars in JS: | ||
+ | |||
+ | <code javascript> | ||
+ | oc_debug=false; | ||
+ | oc_webroot="/ | ||
+ | oc_appswebroots={" | ||
+ | dayNames=[" | ||
+ | var monthNames=[" | ||
+ | var firstDay=0; | ||
+ | var oc_config={" | ||
+ | </ |