CC-2536:Should set realpath of directory in MusicDir
- fixed
This commit is contained in:
parent
be7af45c66
commit
4acf835fe1
|
@ -561,7 +561,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$api_key = $request->getParam('api_key');
|
$api_key = $request->getParam('api_key');
|
||||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
$path = base64_decode($request->getParam('path'));
|
||||||
|
|
||||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||||
{
|
{
|
||||||
|
@ -578,7 +578,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$api_key = $request->getParam('api_key');
|
$api_key = $request->getParam('api_key');
|
||||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
$path = base64_decode($request->getParam('path'));
|
||||||
|
|
||||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||||
{
|
{
|
||||||
|
@ -595,7 +595,7 @@ class ApiController extends Zend_Controller_Action
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$api_key = $request->getParam('api_key');
|
$api_key = $request->getParam('api_key');
|
||||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
$path = base64_decode($request->getParam('path'));
|
||||||
|
|
||||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,6 +47,7 @@ class MusicDir {
|
||||||
{
|
{
|
||||||
$dir = new CcMusicDirs();
|
$dir = new CcMusicDirs();
|
||||||
$dir->setType($p_type);
|
$dir->setType($p_type);
|
||||||
|
$p_path = realpath($p_path)."/";
|
||||||
$temp = $dir->setDirectory($p_path);
|
$temp = $dir->setDirectory($p_path);
|
||||||
try{
|
try{
|
||||||
$dir->save();
|
$dir->save();
|
||||||
|
@ -119,6 +120,7 @@ class MusicDir {
|
||||||
{
|
{
|
||||||
$dir = self::getStorDir();
|
$dir = self::getStorDir();
|
||||||
// if $p_dir doesn't exist in DB
|
// if $p_dir doesn't exist in DB
|
||||||
|
$p_dir = realpath($p_dir)."/";
|
||||||
$exist = $dir->getDirByPath($p_dir);
|
$exist = $dir->getDirByPath($p_dir);
|
||||||
if($exist == NULL){
|
if($exist == NULL){
|
||||||
$dir->setDirectory($p_dir);
|
$dir->setDirectory($p_dir);
|
||||||
|
@ -145,6 +147,7 @@ class MusicDir {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function removeWatchedDir($p_dir){
|
public static function removeWatchedDir($p_dir){
|
||||||
|
$p_dir = realpath($p_dir)."/";
|
||||||
$dir = MusicDir::getDirByPath($p_dir);
|
$dir = MusicDir::getDirByPath($p_dir);
|
||||||
if($dir == NULL){
|
if($dir == NULL){
|
||||||
return array("code"=>1,"error"=>"$p_dir doesn't exist in the watched list");
|
return array("code"=>1,"error"=>"$p_dir doesn't exist in the watched list");
|
||||||
|
|
Loading…
Reference in New Issue