diff --git a/inc/lib_base.php b/inc/lib_base.php index 521694bf53..49dfaf811c 100644 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -40,6 +40,7 @@ $SUBURI=substr(realpath($_SERVER["SCRIPT_FILENAME"]),strlen($SERVERROOT)); $WEBROOT=substr($_SERVER["SCRIPT_NAME"],0,strlen($_SERVER["SCRIPT_NAME"])-strlen($SUBURI)); + if($WEBROOT!='' and $WEBROOT[0]!=='/'){ $WEBROOT='/'.$WEBROOT; } @@ -128,6 +129,14 @@ $loginresult=OC_USER::loginlisener(); class OC_UTIL { public static $scripts=array(); + /** + * get the current installed version of ownCloud + * @return array + */ + public static function getVersion(){ + return array(1,0,60); + } + /** * add a javascript file * diff --git a/inc/lib_plugin.php b/inc/lib_plugin.php index 178179a05e..6c63139b74 100644 --- a/inc/lib_plugin.php +++ b/inc/lib_plugin.php @@ -34,9 +34,30 @@ class OC_PLUGIN{ if(is_dir($SERVERROOT.'/plugins/'.$id) and is_file($SERVERROOT.'/plugins/'.$id.'/plugin.xml')){ $plugin=new DOMDocument(); $plugin->load($SERVERROOT.'/plugins/'.$id.'/plugin.xml'); + if($plugin->documentElement->getAttribute('version')!=='1.0'){ //we only support this for now + return false; + } + $minVersion=$plugin->getElementsByTagName('require'); + if($minVersion->length>0){ + $minVersion=$minVersion->item(0)->textContent; + $minVersion=explode('.',$minVersion); + $version=OC_UTIL::getVersion(); + $roundTo=count($minVersion); + while(count($version)>$roundTo){ + if($version[count($version)-1]>=50){ + $version[count($version)-2]++; + } + unset($version[count($version)-1]); + } + for($i=0;$igetElementsByTagName('id')->item(0)->textContent; if($pluginId==$id){//sanity check for plugins installed in the wrong folder - $childs=$plugin->documentElement->childNodes; + $childs=$plugin->getElementsByTagName('runtime')->item(0)->childNodes; foreach($childs as $child){ if($child->nodeType==XML_ELEMENT_NODE and $child->tagName=='include'){ $file=$SERVERROOT.'/plugins/'.$id.'/'.$child->textContent; diff --git a/inc/templates/footer.php b/inc/templates/footer.php index 47bebd27e0..b82e87777a 100644 --- a/inc/templates/footer.php +++ b/inc/templates/footer.php @@ -12,10 +12,10 @@ Hint: Mount it via webdav like this: - diff --git a/plugins/ldap/plugin.xml b/plugins/ldap/plugin.xml index c58ac4dd3d..2127d13e08 100644 --- a/plugins/ldap/plugin.xml +++ b/plugins/ldap/plugin.xml @@ -1,11 +1,14 @@ - - + + ldap LDAP support for ownCloud 0.1 AGPL fabian - - lib_ldap.php + 1.1 + + + lib_ldap.php + \ No newline at end of file diff --git a/plugins/music/plugin.xml b/plugins/music/plugin.xml index 5377e439ae..bac4f5e8e2 100644 --- a/plugins/music/plugin.xml +++ b/plugins/music/plugin.xml @@ -1,11 +1,14 @@ - + music Music player for ownCloud 0.1 AGPL 2010 Frank Karlitschek karlitschek@kde.org + 1.1 - lib_music.php + + lib_music.php + diff --git a/plugins/test/plugin.xml b/plugins/test/plugin.xml index 5f510f2c38..b666b5bc53 100644 --- a/plugins/test/plugin.xml +++ b/plugins/test/plugin.xml @@ -1,12 +1,15 @@ - + test Test plugin 0.1 AGPL 2010 Frank Karlitschek karlitschek@kde.org + 1.1 - lib_test.php + + lib_test.php +