Index: pro-violet-viettel/www/deploy/api/api.log
===================================================================
--- pro-violet-viettel/www/deploy/api/api.log	(revision 783)
+++ 	(revision )
@@ -1,6 +1,0 @@
-/srv/www/violet/web/uploads/space/0//Desert.jpg
-/srv/www/violet/web/uploads/space/0//Hydrangeas.jpg
-2015-01-19 10:10:29 - FILE: /srv/www/violet/apps/platform/modules/space/actions/actions.class.php - LINE: 50 - /srv/www/violet/web/uploads/space/3/3261/Lighthouse.jpg
-2015-01-19 10:13:12 - FILE: /srv/www/violet/apps/platform/modules/space/actions/actions.class.php - LINE: 50 - /srv/www/violet/web/uploads/space/3/3262/Koala.jpg - FILE EXISTED: 
-2015-01-19 10:50:22 - FILE: /srv/www/violet/apps/platform/modules/space/actions/actions.class.php - LINE: 29 - /srv/www/violet/web/uploads/copying/116_Tulips.jpg - FILE EXISTED: false
-2015-01-19 10:51:22 - FILE: /srv/www/violet/apps/platform/modules/space/actions/actions.class.php - LINE: 29 - /srv/www/violet/web/uploads/copying/116_Koala.jpg - FILE EXISTED: false
Index: pro-violet-viettel/www/deploy/api/platform/config/app.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/app.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/app.yml	(revision 784)
@@ -0,0 +1,11 @@
+# default values
+all:
+  basehost:       api.violet.vn
+
+  convert_exe:    /usr/bin/convert
+  identify_exe:   /usr/bin/identify
+  mplayer_exe:    /usr/bin/mplayer
+  flvtool2_exe:   /usr/bin/flvtool2
+  ffmpeg_exe:     /usr/local/bin/ffmpeg
+  swfdump_exe:    /usr/local/bin/swfdump
+  7z_exe:         /usr/local/bin/7z
Index: pro-violet-viettel/www/deploy/api/platform/config/cache.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/cache.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/cache.yml	(revision 784)
@@ -0,0 +1,4 @@
+default:
+  enabled:     off
+  with_layout: false
+  lifetime:    86400
Index: pro-violet-viettel/www/deploy/api/platform/config/config.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/config.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/config.php	(revision 784)
@@ -0,0 +1,8 @@
+<?php
+
+// include project configuration
+include(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
+
+// symfony bootstraping
+require_once($sf_symfony_lib_dir.'/util/sfCore.class.php');
+sfCore::bootstrap($sf_symfony_lib_dir, $sf_symfony_data_dir);
Index: pro-violet-viettel/www/deploy/api/platform/config/factories.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/factories.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/factories.yml	(revision 784)
@@ -0,0 +1,35 @@
+cli:
+  controller:
+    class: sfConsoleController
+  request:
+    class: sfConsoleRequest
+  response:
+    class: sfConsoleResponse
+
+test:
+  storage:
+    class: sfSessionTestStorage
+
+#all:
+#  controller:
+#    class: sfFrontWebController
+#
+#  request:
+#    class: sfWebRequest
+#
+#  response:
+#    class: sfWebResponse
+#
+#  user:
+#    class: myUser
+#
+#  storage:
+#    class: sfSessionStorage
+#    param:
+#      session_name: symfony
+#
+#  view_cache:
+#    class: sfFileCache
+#    param:
+#      automaticCleaningFactor: 0
+#      cacheDir:                %SF_TEMPLATE_CACHE_DIR%
Index: pro-violet-viettel/www/deploy/api/platform/config/filters.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/filters.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/filters.yml	(revision 784)
@@ -0,0 +1,10 @@
+rendering: ~
+web_debug: ~
+security:  ~
+
+# generally, you will want to insert your own filters here
+
+cache:     ~
+common:    ~
+flash:     ~
+execution: ~
Index: pro-violet-viettel/www/deploy/api/platform/config/i18n.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/i18n.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/i18n.yml	(revision 784)
@@ -0,0 +1,7 @@
+#all:
+#  default_culture:     en
+#  source:              XLIFF
+#  debug:               off
+#  cache:               on
+#  untranslated_prefix: "[T]"
+#  untranslated_suffix: "[/T]"
Index: pro-violet-viettel/www/deploy/api/platform/config/logging.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/logging.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/logging.yml	(revision 784)
@@ -0,0 +1,22 @@
+prod:
+  enabled: off
+  level:   err
+  rotate:  on
+  purge:   off
+
+#all:
+#  enabled: on
+#  level:   debug
+#  rotate:  off
+#  period:  7
+#  history: 10
+#  purge:   on
+#  loggers:
+#    sf_web_debug:
+#      class: sfWebDebugLogger
+#      param:
+#        condition: %SF_WEB_DEBUG%
+#    sf_file_debug:
+#      class: sfFileLogger
+#      param:
+#        file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
Index: pro-violet-viettel/www/deploy/api/platform/config/routing.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/routing.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/routing.yml	(revision 784)
@@ -0,0 +1,15 @@
+# default rules
+homepage:
+  url:   /
+  param: { module: default, action: index }
+
+default_symfony:
+  url:   /symfony/:action/*
+  param: { module: default }
+
+default_index:
+  url:   /:module
+  param: { action: index }
+
+default:
+  url:   /:module/:action/*
Index: pro-violet-viettel/www/deploy/api/platform/config/security.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/security.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/security.yml	(revision 784)
@@ -0,0 +1,2 @@
+default:
+  is_secure: off
Index: pro-violet-viettel/www/deploy/api/platform/config/settings.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/settings.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/settings.yml	(revision 784)
@@ -0,0 +1,103 @@
+prod:
+  .settings:
+    no_script_name:           ##NO_SCRIPT_NAME##
+
+dev:
+  .settings:
+    # E_ALL | E_STRICT = 4095
+    error_reporting:        4095
+    web_debug:              on
+    cache:                  off
+    no_script_name:         off
+    etag:                   off
+
+test:
+  .settings:
+    # E_ALL | E_STRICT & ~E_NOTICE = 2047
+    error_reporting:        2047
+    cache:                  off
+    web_debug:              off
+    no_script_name:         off
+    etag:                   off
+
+#all:
+#  .actions:
+#    default_module:         default   # Default module and action to be called when
+#    default_action:         index     # A routing rule doesn't set it
+#
+#    error_404_module:       default   # To be called when a 404 error is raised
+#    error_404_action:       error404  # Or when the requested URL doesn't match any route
+#
+#    login_module:           default   # To be called when a non-authenticated user
+#    login_action:           login     # Tries to access a secure page
+#
+#    secure_module:          default   # To be called when a user doesn't have
+#    secure_action:          secure    # The credentials required for an action
+#
+#    module_disabled_module: default   # To be called when a user requests 
+#    module_disabled_action: disabled  # A module disabled in the module.yml
+#
+#    unavailable_module:     default   # To be called when a user requests a page
+#    unavailable_action:  unavailable  # From an application disabled via the available setting below
+#
+#  .settings:
+#    available:              on        # Enable the whole application. Switch to off to redirect all requests to the unavailable module and action.
+#
+#    # Optional features. Deactivating unused features boots performance a bit.
+#    use_database:           on        # Enable database manager. Set to off if you don't use a database.
+#    use_security:           on        # Enable security features (login and credentials). Set to off for public applications.
+#    use_flash:              on        # Enable flash parameter feature. Set to off if you never use the set_flash() method in actions.
+#    i18n:                   off       # Enable interface translation. Set to off if your application should not be translated.
+#    check_symfony_version:  off       # Enable check of symfony version for every request. Set to on to have symfony clear the cache automatically when the framework is upgraded. Set to off if you always clear the cache after an upgrade.
+#    use_process_cache:      on        # Enable symfony optimizations based on PHP accelerators. Set to off for tests or when you have enabled a PHP accelerator in your server but don't want symfony to use it internally.
+#    compressed:             off       # Enable PHP response compression. Set to on to compress the outgoing HTML via the PHP handler.
+#    check_lock:             off       # Enable the application lock system triggered by the clear-cache and disable tasks. Set to on to have all requests to disabled applications redirected to the $sf_symfony_data_dir/web/arrors/unavailable.php page.
+#
+#    # Output escaping settings
+#    escaping_strategy:      bc        # Determines how variables are made available to templates. Accepted values: bc, both, on, off. The value off deactivates escaping completely and gives a slight boost.
+#    escaping_method:   ESC_ENTITIES   # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES.
+#
+#    # Routing settings
+#    suffix:                 .         # Default suffix for generated URLs. If set to a single dot (.), no suffix is added. Possible values: .html, .php, and so on.
+#    no_script_name:         off       # Enable the front controller name in generated URLs
+#
+#    # Validation settings, used for error generation by the Validation helper
+#    validation_error_prefix:    ' &darr;&nbsp;'
+#    validation_error_suffix:    ' &nbsp;&darr;'
+#    validation_error_class:     form_error
+#    validation_error_id_prefix: error_for_
+#
+#    # Cache settings
+#    cache:                  off       # Enable the template cache
+#    etag:                   on        # Enable etag handling
+#
+#    # Logging and debugging settings
+#    web_debug:              off       # Enable the web debug toolbar
+#    error_reporting:        341       # Determines which events are logged. The default value is E_PARSE | E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_USER_ERROR = 341
+#
+#    # Assets paths
+#    rich_text_js_dir:       js/tiny_mce
+#    prototype_web_dir:      /sf/prototype
+#    admin_web_dir:          /sf/sf_admin
+#    web_debug_web_dir:      /sf/sf_web_debug
+#
+#    # Helpers included in all templates by default
+#    standard_helpers:       [Partial, Cache, Form]
+#
+#    # Activated modules from plugins or from the symfony core
+#    enabled_modules:        [default]
+#
+#    # Charset used for the response
+#    charset:                utf-8
+#
+#    # Miscellaneous
+#    strip_comments:         on         # Remove comments in core framework classes as defined in the core_compile.yml
+#    autoloading_functions:  ~          # Functions called when a class is requested and this it is not already loaded. Expects an array of callables. Used by the framework bridges.
+#    timeout:                1800       # Session timeout, in seconds
+#    max_forwards:           5
+#    path_info_array:        SERVER
+#    path_info_key:          PATH_INFO
+#    url_format:             PATH
+#
+#    # ORM
+#    orm:                    propel
Index: pro-violet-viettel/www/deploy/api/platform/config/view.yml
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/config/view.yml	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/config/view.yml	(revision 784)
@@ -0,0 +1,13 @@
+default:
+  http_metas:
+    content-type: text/html
+
+  metas:
+    robots:       index, follow
+    language:     en
+
+  stylesheets:    []
+
+  javascripts:    []
+
+  has_layout:     off
Index: pro-violet-viettel/www/deploy/api/platform/lib/violetUtil.class.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/lib/violetUtil.class.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/lib/violetUtil.class.php	(revision 784)
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Utility functions for violet application
+ *
+ */
+class violetUtil {
+
+  public static function getSpacePath($absolute = true) {
+    if ($absolute) {
+      return sfConfig::get('sf_upload_dir').'/'.sfConfig::get('app_space_dir').'/';
+    } else {
+      return sfConfig::get('sf_upload_dir_name').'/'.sfConfig::get('app_space_dir').'/';
+    }
+  }
+
+  public static function getTempPath($subDir = '', $create = false) {
+    $tempPath = sfConfig::get('sf_upload_dir') .'/'. sfConfig::get('app_temp_dir') .'/'. $subDir;
+    if ($create && !file_exists($tempPath)) mkdir($tempPath, 0777, true);
+    return $tempPath;
+  }
+
+  public static function getContentType($fileType) {
+    switch (strtolower($fileType)) {
+      case 'xml':
+      case 'xvl': return 'text/xml';
+
+      case 'jpe':
+      case 'jpg':
+      case 'jpeg': return 'image/jpeg';
+      case 'gif': return 'image/gif';
+      case 'png': return 'image/png';
+
+      case 'flv': return 'video/x-flv';
+      case 'mp4': return 'video/mp4';
+      case 'mp3': return 'audio/mpeg';
+      case 'swf': return 'application/x-shockwave-flash';
+    }
+  }
+}
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php	(revision 784)
@@ -0,0 +1,446 @@
+<?php
+
+/**
+ * space actions.
+ *
+ * @package    violetspace
+ * @subpackage space
+ * @author     Your name here
+ * @version    SVN: $Id: actions.class.php 2692 2006-11-15 21:03:55Z fabien $
+ */
+class spaceActions extends sfActions
+{
+  /**
+   * Executes index action
+   *
+   */
+  public function executeIndex()
+  {
+    $this->forward('default', 'module');
+  }
+  private function CreateSpaceDir($folderName, $parentId, $userId) {
+    $c = new Criteria();
+    $c->add(TblspacecategoryPeer::CAT_PARENT, $parentId);
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $c->add(TblspacecategoryPeer::CAT_NAME, $folderName);
+    $category = TblspacecategoryPeer::doSelectOne($c);
+    if ($category != null) {
+    	$folderName = 'Copy of '.$folderName;
+    }else{
+      $category = new Tblspacecategory();
+      $category->setCatName($folderName);
+      $category->setCatParent($parentId);
+      $category->setCatUser($userId);
+      $category->setCatDate(date('Y-m-d H:i:s'));
+      $category->save();
+    }
+    return $category->getCatId();
+  }
+
+  private function CreateSpaceFile($file, $fileName, $fileSize, $catId, $userId) {
+    $tblres = new Tblspaceresource();
+    $tblres->setResFilename($fileName);
+    $tblres->setResFilesize($fileSize);
+    $tblres->setResFilecrc(crc32(file_get_contents($file)));
+    $tblres->save();
+	rename($file, $tblres->getFullFilename(true));
+
+    $tblfile = new Tblspacefile();
+    $tblfile->setFileResource($tblres->getResId());
+    $tblfile->setFileCategory($catId);
+    $tblfile->setFileUser($userId);
+    $tblfile->setFileName($fileName);
+    $tblfile->setFileDate(date('Y-m-d H:i:s'));
+    $tblfile->save();
+    $type = $tblfile->getFileType();
+    $filePath = $tblres->getFullFilename();
+    if (in_array($type, array('avi', 'mpg', 'mpeg', 'mpe', 'mpa', 'wmv', 'asf', 'mov', 'qt', '3gp'))) {
+      $flvName = myUtility::getFileName($filePath).'.flv';
+      sfConversion::MovieToFlv($filePath, $flvName);
+    }
+    if (in_array($type, array('bmp', 'ico', 'wmf', 'emf'))) {
+      $jpgName = myUtility::getFileName($filePath).'.jpg';
+      sfConversion::ImageToJpg($filePath, $jpgName);
+    }
+    return $tblfile;
+  }
+
+  private function MoveDirToSpace($path, $catId, $userId) {
+    foreach (scandir($path) as $dir) {
+      if ($dir=='.' || $dir=='..') continue;
+      $dname = $path.'/'.$dir;
+      if (is_dir($dname)) {
+        $subCatId = $this->CreateSpaceDir($dir, $catId, $userId);
+        $this->MoveDirToSpace($dname, $subCatId, $userId);
+      } else {
+        $this->CreateSpaceFile($dname, $dir, filesize($dname), $catId, $userId);
+      }
+    }
+    rmdir($path);
+  }
+
+  private function CopySpaceDir ($sourceObj, $destination, $userId, &$aryNewTree) {
+    $dirId = $sourceObj->id;
+    $c = new Criteria();
+    $c->add(TblspacecategoryPeer::CAT_ID, $dirId);
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $currentDir = TblspacecategoryPeer::doSelectOne($c);
+	
+    $newDirID =  $this->CreateSpaceDir($currentDir->getCatName(), $destination, $userId);
+    
+    $c = new Criteria();
+    $c->add(TblspacecategoryPeer::CAT_ID, $newDirID);
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $newCat = TblspacecategoryPeer::doSelectOne($c);
+    
+    $newDir = new stdClass();
+    $newDir->id = $newDirID;
+    $newDir->name = $newCat->getCatName();
+    $newDir->parentID = $newCat->getCatParent();
+    
+    $aryNewTree['DIRECTORIES'][] = $newDir;
+
+    if (isset($sourceObj->files)) {
+      $aryChidlFiles = $sourceObj->files;
+      foreach ($aryChidlFiles as $key => $file) {
+        $aryNewTree['FILES'][] = $this->CopySpaceFile($file->id, $newDirID, $userId);
+      }
+    }
+
+    if (isset($sourceObj->childs)) {
+      $aryChidlDirs = $sourceObj->childs;
+      foreach ($aryChidlDirs as $key => $dir) {
+        $this->CopySpaceDir($dir, $newDirID, $userId, $aryNewTree);
+      }
+    }
+  }
+
+  private function CopySpaceFile ($fileId, $destination, $userId) {
+  	$newFile = new stdClass();
+    $c = new Criteria();
+    $c->add(TblspacefilePeer::FILE_ID, $fileId);
+    $c->add(TblspacefilePeer::FILE_USER, $userId);
+    $currentFile = TblspacefilePeer::doSelectOne($c);
+    $fileName = $currentFile->getFileCategory() == $destination ? 'Copy of '.$currentFile->getFileName():$currentFile->getFileName();    
+      
+    $tblfile = new Tblspacefile();
+    $tblfile->setFileResource($currentFile->getFileResource());
+    $tblfile->setFileCategory($destination);
+    $tblfile->setFileUser($userId);
+    $tblfile->setFileName($fileName);
+    $tblfile->setFileType($currentFile->getFileType());
+    $tblfile->setFileDate(date('Y-m-d H:i:s'));
+    $tblfile->save();
+    $newFile->id = $tblfile->getFileId();
+    $newFile->name = $fileName;
+    $newFile->parentID = $destination;
+    $newFile->minetype = $currentFile->getFileType();
+    return $newFile;
+  }
+  
+  private function changeParentDir ($item, $destination) {
+  	if ($item->type == 'directory') {
+  		$tblfile = TblspacefilePeer::retrieveByPk($item->id);
+  		$tblfile->setFileCategory($destination);
+  		$tblfile->save();
+  	}
+  	else if ($item->type == 'file') {
+  		$tblCategory = TblspacecategoryPeer::retrieveByPk($item->id);
+  		$tblCategory->setCatParent($destination);
+  		$tblCategory->save();
+  	}
+  	
+  	$item->parentID = $destination;
+  	return $item;
+  }
+
+  public function executeDir() {
+    $this->catId = $this->getRequestParameter('id', -1);
+    $userId = $this->getRequestParameter('userid');
+    $filter = $this->getRequestParameter('filter');
+    $isGetAll = $this->getRequestParameter('isgetall');
+    $sortDirBy = $this->getRequestParameter('sortdirby');
+    $sortFileBy = $this->getRequestParameter('sortfileby');
+
+    $isGetAll = $isGetAll != 1 ? 0:1;
+    // find parent ID of this category
+    if ($this->catId != -1) {
+      $c = new Criteria();
+      $c->add(TblspacecategoryPeer::CAT_ID, $this->catId);
+      $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+      $thisCat = TblspacecategoryPeer::doSelectOne($c);
+      $this->parentId = $thisCat? $thisCat->getCatParent(): '-1';
+    }
+    else $this->parentId = '';
+
+    // find subcategory of this category
+    $c = new Criteria();
+    if ($isGetAll == 0)
+    $c->add(TblspacecategoryPeer::CAT_PARENT, $this->catId);
+    
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $c->addAscendingOrderByColumn(TblspacecategoryPeer::CAT_PARENT);
+    $c->addAscendingOrderByColumn(TblspacecategoryPeer::CAT_ID);
+    $c->addAscendingOrderByColumn(TblspacecategoryPeer::CAT_NAME);
+    $this->tblcategories = TblspacecategoryPeer::doSelect($c);
+
+    // find files in this category folder
+    $c = new Criteria();
+    if ($isGetAll == 0)
+		$c->add(TblspacefilePeer::FILE_CATEGORY, $this->catId);
+
+    $c->add(TblspacefilePeer::FILE_USER, $userId);
+    if ($filter) $c->add(TblspacefilePeer::FILE_TYPE, explode(';', $filter), Criteria::IN);
+    $c->addAscendingOrderByColumn(TblspacefilePeer::FILE_NAME);
+    $this->tblfiles = TblspacefilePeer::doSelect($c);
+    $this->isGetAll = $isGetAll;
+    $this->errMsg = '';
+    $this->errCode = '';
+  }
+  
+  public function executeMkdir() {
+    $userId = $this->getRequestParameter('userid');
+    $parentId = $this->getRequestParameter('parent_id');
+    $folderName = $this->getRequestParameter('name');
+    $this->catId = $this->CreateSpaceDir($folderName, $parentId, $userId);
+    $this->errCode = '';
+    $this->errMsg = '';
+  }
+
+  public function executeDelete() {
+    //if (!$this->checkAuthentication()) return sfView::NONE;
+    $userId = $this->getRequestParameter('userid');
+    $type = $this->getRequestParameter('type');
+    $id = $this->getRequestParameter('id');
+
+    switch ($type) {
+      case 'folder': 
+        $c1 = new Criteria();
+        $c2 = new Criteria();
+        $c1->add(TblspacecategoryPeer::CAT_USER, $userId);
+        $c1->add(TblspacecategoryPeer::CAT_PARENT, $id);
+        $c2->add(TblspacefilePeer::FILE_USER, $userId);
+        $c2->add(TblspacefilePeer::FILE_CATEGORY, $id);
+        if (TblspacecategoryPeer::doCount($c1) > 0 || TblspacefilePeer::doCount($c2) > 0) {
+          $this->errMsg = 'Folder is not empty!';
+          $this->errCode = 'errFolderNotEmpty';
+          return;
+        }
+        $c = new Criteria();
+        $c->add(TblspacecategoryPeer::CAT_ID, $id);
+        $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+        TblspacecategoryPeer::doDelete($c);
+        break;
+
+      case 'file':
+        $c = new Criteria();
+        $c->add(TblspacefilePeer::FILE_ID, $id);
+        $c->add(TblspacefilePeer::FILE_USER, $userId);
+        $tblfile = TblspacefilePeer::doSelectOne($c);
+        if ($tblfile) $tblfile->delete();
+        break;
+    }
+    $this->errMsg = '';
+    $this->errCode = '';
+  }
+
+  public function executeDeletemulti () {
+  	$userId = $this->getRequestParameter('userid');
+  	$aryDel = $this->getRequestParameter('delobj');
+  	$this->aryDeletedObj = json_decode($aryDel);
+  	
+  	$aryDirID = array();
+  	$aryFileID = array();
+  	
+  	if (is_array($this->aryDeletedObj)) {
+  		foreach ($this->aryDeletedObj as $key => $obj) {
+  			if ($obj->type == 'directory') {
+  				if (is_array($obj->childDirs)) {
+  					foreach ($obj->childDirs as $childDir) {
+  						$aryDirID[] = $childDir->id;
+  					}
+  				}
+  				
+  				if (is_array($obj->childFiles)) {
+  					foreach ($obj->childFiles as $childFile) {
+  						$aryFileID[] = $childFile->id;
+  					}
+  				}
+  				$aryDirID[] = $obj->id;
+  			}
+  			else {
+  				$aryFileID[] = $obj->id;
+  			}
+  		}
+  	}
+  	
+   	if (count($aryFileID) > 0) {
+   		foreach ($aryFileID as $id) {
+   			$c = new Criteria();
+   			$c->add(TblspacefilePeer::FILE_ID, $id);
+   			$c->add(TblspacefilePeer::FILE_USER, $userId);
+   			$tblfile = TblspacefilePeer::doSelectOne($c);
+   			if ($tblfile) $tblfile->delete();
+   		}
+   	}  	
+  	
+   	if (count($aryDirID) > 0) {
+ 	  	$c = new Criteria();
+ 	  	$c->add(TblspacecategoryPeer::CAT_USER, $userId);
+ 	  	$c->add(TblspacecategoryPeer::CAT_ID, $aryDirID, Criteria::IN);
+ 	  	TblspacecategoryPeer::doDelete($c);
+   	}
+  	
+  	$this->errMsg = '';
+  	$this->errCode = '';
+  }
+
+  public function executeCopy () {
+    $userId = $this->getRequestParameter('userid');
+    $destination = $this->getRequestParameter('destination');
+    $act = $this->getRequestParameter('act');
+    $data = $this->getRequestParameter('data');
+	$aryNewTree = array('DIRECTORIES' => array(),'FILES' => array(), );
+    $aryTreeObj = json_decode($data);
+    
+    if (is_array($aryTreeObj)) {
+    	foreach ($aryTreeObj as $key => $treeObj){
+    		 if ($act == 'copy') {
+	    		if ($treeObj->type == 'directory') {
+	    			$this->CopySpaceDir($treeObj, $destination, $userId, $aryNewTree);
+	    		}
+	    		else {
+	    			$aryNewTree['FILES'] = $this->CopySpaceFile($treeObj->id, $destination, $userId);
+	    		}
+    		}
+    		else if ($act == 'move') {
+    			$this->changeParentDir($treeObj, $destination);
+    			if ($treeObj->type == 'directory') $aryNewTree['DIRECTORIES'][] = $treeObj;
+    			if ($treeObj->type == 'file') $aryNewTree['FILES'][] = $treeObj;
+    		} 
+    	}
+    }
+    
+    $this->errMsg = '';
+    $this->errCode = '';
+    $this->aryNewTree = $aryNewTree;
+  }
+
+  public function executeUpload() { 
+    //if (!$this->checkAuthentication()) return sfView::NONE;
+    $userId = $this->getRequestParameter('userid'); 
+    $catId = $this->getRequestParameter('dir');
+    $response = $this->getRequestParameter('response');
+    
+    if ($this->getRequest()->hasErrors()) return false;
+    if (!$this->getRequest()->hasFiles()) return true;
+	
+    $file = reset($this->getRequest()->getFileNames());
+    $fileName = $this->getRequest()->getFileName($file);
+    $fileType = $this->getRequest()->getFileType($file);
+    $fileSize = $this->getRequest()->getFileSize($file);
+    $fileError = $this->getRequest()->hasFileError($file);
+    $fileErrorNum = $this->getRequest()->getFileError($file);
+    
+    if ($fileErrorNum || $fileError) return false;
+
+    $tempFile = violetUtil::getTempPath().$userId.'_'.$fileName;
+		
+    $this->getRequest()->moveFile($file, $tempFile);
+
+	if ($this->getRequestParameter('unpack') == 'true') {
+      $tempPath = violetUtil::getTempPath($userId.'_'.date("YmdHis"), true);
+      myZip::Unzip($tempFile, $tempPath);
+      $this->MoveDirToSpace($tempPath, $catId, $userId);
+      unlink($tempFile);
+    } else {
+      $tblfile=$this->CreateSpaceFile($tempFile, $fileName, $fileSize, $catId, $userId); 
+      $tblres = TblspacefilePeer::retrieveByPk($tblfile->getFileId())->getTblspaceresource();
+      $filePath = $tblres->getFullFilename();
+      $fileUrl=  str_replace("/srv/www/violet/web", "http://sbgapi.violet.vn", $filePath);
+    }   
+    if ($response==1)
+    {
+      $aryError = array('err' => "", 'errCode' => 0);
+      $ext = pathinfo($fileUrl, PATHINFO_EXTENSION);	
+      $aryFiles = array(
+		0 => array('id' => $tblfile->getFileId(),'fileurl'=>$fileUrl, 'name' => $fileName, 'minetype' => $ext, 'size' => $fileSize, 'parentID' => $catId),
+          );
+      $aryData = array('DIRECTORIES' =>  array() , 'FILES' => $aryFiles, 'ERROR' => $aryError);
+      echo json_encode($aryData);
+	
+    }
+    return sfView::NONE;
+    
+  }
+
+  public function executeSave() {
+    $content = file_get_contents('php://input');
+    if ($content == '') {
+      $this->errMsg = 'Error when saving file';
+      $this->errCode = 'errSave6'; // khong tim thay noi dung bai giang
+      return;
+    }
+    $this->fileId = $this->getRequestParameter('fileid', '');
+    if ($this->fileId == '') {
+      $userId = $this->getRequestParameter('userid');
+      $fileName = $this->getRequestParameter('name');
+      $catId = $this->getRequestParameter('dir', -1);
+
+      $tblres = new Tblspaceresource();
+      $tblres->setResFilename($fileName);
+      $tblres->setResFilesize(strlen($content));
+      $tblres->setResFilecrc(crc32($content));
+      $tblres->save();
+      file_put_contents($tblres->getFullFilename(true), $content);
+
+      $tblfile = new Tblspacefile();
+      $tblfile->setFileResource($tblres->getResId());
+      $tblfile->setFileCategory($catId);
+      $tblfile->setFileUser($userId);
+      $tblfile->setFileName($fileName);
+      $tblfile->setFileDate(date('Y-m-d H:i:s'));
+      $tblfile->save();
+      $this->fileId = $tblfile->getFileId();
+    } else {
+      $tblfile = TblspacefilePeer::retrieveByPk($this->fileId);
+      $tblfile->setFileDate(date('Y-m-d H:i:s'));
+      $tblfile->save();
+
+      $tblres = $tblfile->getTblspaceresource();
+      $tblres->setResFilesize(strlen($content));
+      $tblres->setResFilecrc(crc32($content));
+      $tblres->save();
+      file_put_contents($tblres->getFullFilename(), $content);
+    }
+	
+    $this->fileName = $fileName;
+    $this->errCode = '';
+    $this->errMsg = '';
+  }
+
+  public function executeFile() {
+    $fileId = $this->getRequestParameter('id');
+    $tblres = TblspacefilePeer::retrieveByPk($fileId)->getTblspaceresource();
+    $fileName = $tblres->getFullFilename();
+    $ext = strtolower(substr($fileName, strrpos($fileName, '.') + 1));
+
+    $userFileName = $this->getRequestParameter('filename');
+    if ($userFileName != null) {
+      $userExt = strtolower(substr($userFileName, strrpos($userFileName, '.') + 1));
+
+      fwrite ($fh, var_export($userExt, TRUE));
+
+      if ($userExt != $ext) {
+        $fileName = substr($fileName, 0, strrpos($fileName, '.')) . ".$userExt";
+        $ext = $userExt;
+      }
+    }
+
+	header('Content-Type: '.violetUtil::getContentType($ext));
+    header('Content-Length: '.filesize($fileName));
+    fpassthru(fopen($fileName, 'rb'));
+    return sfView::NONE;
+  }
+}
+?>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php.bak
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php.bak	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/actions/actions.class.php.bak	(revision 784)
@@ -0,0 +1,247 @@
+<?php
+
+class spaceActions extends sfActions
+{
+  private function CreateSpaceDir($folderName, $parentId, $userId) {
+    $c = new Criteria();
+    $c->add(TblspacecategoryPeer::CAT_PARENT, $parentId);
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $c->add(TblspacecategoryPeer::CAT_NAME, $folderName);
+    $category = TblspacecategoryPeer::doSelectOne($c);
+    if ($category == null) {
+      $category = new Tblspacecategory();
+      $category->setCatName($folderName);
+      $category->setCatParent($parentId);
+      $category->setCatUser($userId);
+      $category->setCatDate(date('Y-m-d H:i:s'));
+      $category->save();
+    }
+    return $category->getCatId();
+  }
+
+  private function CreateSpaceFile($file, $fileName, $fileSize, $catId, $userId) {
+    $tblres = new Tblspaceresource();
+    $tblres->setResFilename($fileName);
+    $tblres->setResFilesize($fileSize);
+    $tblres->setResFilecrc(crc32(file_get_contents($file)));
+    $tblres->save();
+	rename($file, $tblres->getFullFilename(true));
+
+    $tblfile = new Tblspacefile();
+    $tblfile->setFileResource($tblres->getResId());
+    $tblfile->setFileCategory($catId);
+    $tblfile->setFileUser($userId);
+    $tblfile->setFileName($fileName);
+    $tblfile->setFileDate(date('Y-m-d H:i:s'));
+    $tblfile->save();
+
+    $type = $tblfile->getFileType();
+    $filePath = $tblres->getFullFilename();
+    if (in_array($type, array('avi', 'mpg', 'mpeg', 'mpe', 'mpa', 'wmv', 'asf', 'mov', 'qt', '3gp'))) {
+      $flvName = myUtility::getFileName($filePath).'.flv';
+      sfConversion::MovieToFlv($filePath, $flvName);
+    }
+    if (in_array($type, array('bmp', 'ico', 'wmf', 'emf'))) {
+      $jpgName = myUtility::getFileName($filePath).'.jpg';
+      sfConversion::ImageToJpg($filePath, $jpgName);
+    }
+  }
+
+  private function MoveDirToSpace($path, $catId, $userId) {
+    foreach (scandir($path) as $dir) {
+      if ($dir=='.' || $dir=='..') continue;
+      $dname = $path.'/'.$dir;
+      if (is_dir($dname)) {
+        $subCatId = $this->CreateSpaceDir($dir, $catId, $userId);
+        $this->MoveDirToSpace($dname, $subCatId, $userId);
+      } else {
+        $this->CreateSpaceFile($dname, $dir, filesize($dname), $catId, $userId);
+      }
+    }
+    rmdir($path);
+  }
+
+  public function executeDir() {
+    $this->catId = $this->getRequestParameter('id', -1);
+    $userId = $this->getRequestParameter('userid');
+    $filter = $this->getRequestParameter('filter');
+    
+    // find parent ID of this category
+    if ($this->catId != -1) {
+      $c = new Criteria();
+      $c->add(TblspacecategoryPeer::CAT_ID, $this->catId);
+      $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+      $thisCat = TblspacecategoryPeer::doSelectOne($c);
+      $this->parentId = $thisCat? $thisCat->getCatParent(): '-1';
+    }
+    else $this->parentId = '';
+
+    // find subcategory of this category
+    $c = new Criteria();
+    $c->add(TblspacecategoryPeer::CAT_PARENT, $this->catId);
+    $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+    $c->addAscendingOrderByColumn(TblspacecategoryPeer::CAT_NAME);
+    $this->tblcategories = TblspacecategoryPeer::doSelect($c);
+
+    // find files in this category folder
+    $c = new Criteria();
+    $c->add(TblspacefilePeer::FILE_CATEGORY, $this->catId);
+    $c->add(TblspacefilePeer::FILE_USER, $userId);
+    if ($filter) $c->add(TblspacefilePeer::FILE_TYPE, explode(';', $filter), Criteria::IN);
+    $c->addAscendingOrderByColumn(TblspacefilePeer::FILE_NAME);
+    $this->tblfiles = TblspacefilePeer::doSelect($c);
+    
+    $this->errMsg = '';
+    $this->errCode = '';
+  }
+  
+  public function executeMkdir() {
+    $userId = $this->getRequestParameter('userid');
+    $parentId = $this->getRequestParameter('parent_id');
+    $folderName = $this->getRequestParameter('name');
+    $this->catId = $this->CreateSpaceDir($folderName, $parentId, $userId);
+    $this->errCode = '';
+    $this->errMsg = '';
+  }
+
+  public function executeDelete() {
+    //if (!$this->checkAuthentication()) return sfView::NONE;
+    $userId = $this->getRequestParameter('userid');
+    $type = $this->getRequestParameter('type');
+    $id = $this->getRequestParameter('id');
+
+    switch ($type) {
+      case 'folder': 
+        $c1 = new Criteria();
+        $c2 = new Criteria();
+        $c1->add(TblspacecategoryPeer::CAT_USER, $userId);
+        $c1->add(TblspacecategoryPeer::CAT_PARENT, $id);
+        $c2->add(TblspacefilePeer::FILE_USER, $userId);
+        $c2->add(TblspacefilePeer::FILE_CATEGORY, $id);
+        if (TblspacecategoryPeer::doCount($c1) > 0 || TblspacefilePeer::doCount($c2) > 0) {
+          $this->errMsg = 'Folder is not empty!';
+          $this->errCode = 'errFolderNotEmpty';
+          return;
+        }
+        $c = new Criteria();
+        $c->add(TblspacecategoryPeer::CAT_ID, $id);
+        $c->add(TblspacecategoryPeer::CAT_USER, $userId);
+        TblspacecategoryPeer::doDelete($c);
+        break;
+
+      case 'file':
+        $c = new Criteria();
+        $c->add(TblspacefilePeer::FILE_ID, $id);
+        $c->add(TblspacefilePeer::FILE_USER, $userId);
+        $tblfile = TblspacefilePeer::doSelectOne($c);
+        if ($tblfile) $tblfile->delete();
+        break;
+    }
+    $this->errMsg = '';
+    $this->errCode = '';
+  }
+
+  public function executeUpload() {
+	
+    //if (!$this->checkAuthentication()) return sfView::NONE;
+    $userId = $this->getRequestParameter('userid');
+    $catId = $this->getRequestParameter('dir');
+
+    if ($this->getRequest()->hasErrors()) return false;
+    if (!$this->getRequest()->hasFiles()) return true;
+	
+    $file = reset($this->getRequest()->getFileNames());
+    $fileName = $this->getRequest()->getFileName($file);
+    $fileType = $this->getRequest()->getFileType($file);
+    $fileSize = $this->getRequest()->getFileSize($file);
+    $fileError = $this->getRequest()->hasFileError($file);
+    $fileErrorNum = $this->getRequest()->getFileError($file);
+
+    if ($fileErrorNum || $fileError) return false;
+
+    $tempFile = violetUtil::getTempPath().$userId.'_'.$fileName;
+		
+    $this->getRequest()->moveFile($file, $tempFile);
+
+	if ($this->getRequestParameter('unpack') == 'true') {
+      $tempPath = violetUtil::getTempPath($userId.'_'.date("YmdHis"), true);
+      myZip::Unzip($tempFile, $tempPath);
+      $this->MoveDirToSpace($tempPath, $catId, $userId);
+      unlink($tempFile);
+    } else {
+      $this->CreateSpaceFile($tempFile, $fileName, $fileSize, $catId, $userId);
+    }
+
+    return sfView::NONE;
+  }
+
+  public function executeSave() {
+    $content = file_get_contents('php://input');
+    if ($content == '') {
+      $this->errMsg = 'Error when saving file';
+      $this->errCode = 'errSave6'; // khong tim thay noi dung bai giang
+      return;
+    }
+    $this->fileId = $this->getRequestParameter('fileid', '');
+    if ($this->fileId == '') {
+      $userId = $this->getRequestParameter('userid');
+      $fileName = $this->getRequestParameter('name');
+      $catId = $this->getRequestParameter('dir', -1);
+
+      $tblres = new Tblspaceresource();
+      $tblres->setResFilename($fileName);
+      $tblres->setResFilesize(strlen($content));
+      $tblres->setResFilecrc(crc32($content));
+      $tblres->save();
+      file_put_contents($tblres->getFullFilename(true), $content);
+
+      $tblfile = new Tblspacefile();
+      $tblfile->setFileResource($tblres->getResId());
+      $tblfile->setFileCategory($catId);
+      $tblfile->setFileUser($userId);
+      $tblfile->setFileName($fileName);
+      $tblfile->setFileDate(date('Y-m-d H:i:s'));
+      $tblfile->save();
+      $this->fileId = $tblfile->getFileId();
+    } else {
+      $tblfile = TblspacefilePeer::retrieveByPk($this->fileId);
+      $tblfile->setFileDate(date('Y-m-d H:i:s'));
+      $tblfile->save();
+
+      $tblres = $tblfile->getTblspaceresource();
+      $tblres->setResFilesize(strlen($content));
+      $tblres->setResFilecrc(crc32($content));
+      $tblres->save();
+      file_put_contents($tblres->getFullFilename(), $content);
+    }
+	
+    $this->fileName = $fileName;
+    $this->errCode = '';
+    $this->errMsg = '';
+  }
+
+  public function executeFile() {
+    $fileId = $this->getRequestParameter('id');
+    $tblres = TblspacefilePeer::retrieveByPk($fileId)->getTblspaceresource();
+    $fileName = $tblres->getFullFilename();
+    $ext = strtolower(substr($fileName, strrpos($fileName, '.') + 1));
+
+    $userFileName = $this->getRequestParameter('filename');
+    if ($userFileName != null) {
+      $userExt = strtolower(substr($userFileName, strrpos($userFileName, '.') + 1));
+
+      fwrite ($fh, var_export($userExt, TRUE));
+
+      if ($userExt != $ext) {
+        $fileName = substr($fileName, 0, strrpos($fileName, '.')) . ".$userExt";
+        $ext = $userExt;
+      }
+    }
+
+	header('Content-Type: '.violetUtil::getContentType($ext));
+    header('Content-Length: '.filesize($fileName));
+    fpassthru(fopen($fileName, 'rb'));
+    return sfView::NONE;
+  }
+}
+?>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/copySuccess.php	(revision 784)
@@ -0,0 +1,4 @@
+<data err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
+	<folderdata><?php echo json_encode($aryNewTree['DIRECTORIES'])?></folderdata>
+	<filedata><?php echo json_encode($aryNewTree['FILES'])?></filedata>
+</data>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deleteSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deleteSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deleteSuccess.php	(revision 784)
@@ -0,0 +1,1 @@
+<status err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>" />
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deletemultiSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deletemultiSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/deletemultiSuccess.php	(revision 784)
@@ -0,0 +1,20 @@
+<tree err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
+<?php foreach ($aryDeletedObj as $obj): ?>
+<?php 	if ($obj->type == 'directory'):?>
+		<folder id="<?php echo $obj->id;?>" parentid="<?php echo $obj->parentID;?>" name="<?php echo $obj->name;?>">
+<?php 		if (is_array($obj->childDirs)):?>
+<?php 			foreach ($obj->childDirs as $childobj):?>
+					<childdir id="<?php echo $childobj->id;?>" parentid="<?php echo $childobj->parentID;?>"><?php echo $childobj->name;?></childdir>
+<?php 			endforeach;?>
+<?php 		endif;?>
+<?php 		if (is_array($obj->childFiles)):?>
+<?php 			foreach ($obj->childFiles as $childobj):?>
+					<childfile id="<?php echo $childobj->id;?>" parentid="<?php echo $childobj->parentID;?>"><?php echo $childobj->name;?></childfile>
+<?php 			endforeach;?>
+<?php 		endif;?>
+		</folder>
+<?php 	else:?> 
+		<file id="<?php echo $obj->id;?>" parentid="<?php echo $obj->parentID;?>" name="<?php echo $obj->name;?>"></file>
+<?php 	endif;?>
+<?php endforeach; ?>
+</tree>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/dirSuccess.php	(revision 784)
@@ -0,0 +1,31 @@
+<tree parent_id="<?php echo $parentId; ?>" err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
+  <!-- folders in current folder -->
+  <?php if($isGetAll == 0):?>  
+  <!-- folders in current folder -->
+  <?php foreach ($tblcategories as $tblcategory): ?>
+    <folder id="<?php echo $tblcategory->getCatId() ?>" name="<?php echo $tblcategory->getCatName() ?>" filetype="" />
+  <?php endforeach; ?>
+  <!-- files in current folder -->
+  <?php foreach ($tblfiles as $tblfile): ?>
+    <file id="<?php echo $tblfile->getFileId() ?>" name="<?php echo $tblfile->getFileName() ?>" filetype="<?php echo $tblfile->getFileType() ?>" />
+  <?php endforeach; ?>
+  <?php endif;?>
+  <?php if($isGetAll == 1):?>  
+  <folderlist>
+  <?php foreach ($tblcategories as $tblcategory): ?>
+    <folder id="<?php echo $tblcategory->getCatId() ?>" parentid="<?php echo $tblcategory->getCatParent() ?>"><?php echo $tblcategory->getCatName() ?></folder>
+  <?php endforeach; ?>
+  </folderlist>
+  <!-- files in current folder -->
+  <filelist>
+  <?php foreach ($tblfiles as $tblfile): ?>
+      <?php
+      $tblres = TblspacefilePeer::retrieveByPk($tblfile->getFileId())->getTblspaceresource();
+      $fileName = $tblres->getFullFilename();
+      $fileName=  str_replace('/srv/www/violet/web', 'http://sbgapi.violet.vn', $fileName);
+      ?> 
+    <file fileurl="<?php echo $fileName;?>" id="<?php echo $tblfile->getFileId() ?>" parentid="<?php echo $tblfile->getFileCategory() ?>" filetype="<?php echo $tblfile->getFileType() ?>"><?php echo $tblfile->getFileName() ?></file>
+  <?php endforeach; ?> 
+  </filelist>
+  <?php endif;?>
+</tree>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/mkdirSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/mkdirSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/mkdirSuccess.php	(revision 784)
@@ -0,0 +1,1 @@
+<status id="<?php echo $catId; ?>" err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>" />
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/moveSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/moveSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/moveSuccess.php	(revision 784)
@@ -0,0 +1,4 @@
+<data err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>">
+	<folderdata><?php echo json_encode($aryNewTree['DIRECTORIES'])?></folderdata>
+	<filedata><?php echo json_encode($aryNewTree['FILES'])?></filedata>
+</data>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/saveSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/saveSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/saveSuccess.php	(revision 784)
@@ -0,0 +1,3 @@
+<?php
+  echo "<status id='$fileId' name='$fileName' err='$errMsg' errCode='$errCode' />";
+?>
Index: pro-violet-viettel/www/deploy/api/platform/modules/space/templates/unpackSuccess.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/space/templates/unpackSuccess.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/space/templates/unpackSuccess.php	(revision 784)
@@ -0,0 +1,1 @@
+<status err="<?php echo $errMsg; ?>" errCode="<?php echo $errCode; ?>" />
Index: pro-violet-viettel/www/deploy/api/platform/modules/user/actions/actions.class.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/modules/user/actions/actions.class.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/modules/user/actions/actions.class.php	(revision 784)
@@ -0,0 +1,418 @@
+<?php
+
+class userActions extends sfActions
+{
+  const TOKENPW = 'violet';
+  
+  public function executeTest() {
+    var_dump(1);
+    return sfView::NONE;
+  }
+
+  private function getUserField($fieldName, $value, $currentId = null) {
+    $c = new Criteria();
+    $c->add($fieldName, $value);
+    if ($currentId) $c->add(TbluserPeer::US_ID, $currentId, Criteria::NOT_EQUAL);
+    return TbluserPeer::doSelectOne($c);
+  }
+
+  private function validateData($name, $email, $phone, &$error, $checkfullname = true) {
+	 $nameValid = $checkfullname ? ($name != null && !myUtility::validate('sfFilterValidator', $name, $error)) || 
+		 ($name != null && !myUtility::validate('sfFullnameValidator', $name, $error)) : TRUE;
+    return
+    $nameValid  ||  ($email != null && !myUtility::validate('sfEmailValidator', $email, $error)) ||
+    ($phone != null && !myUtility::validate('sfPhoneValidator', $phone, $error));
+  }
+
+  private function getUserInfo($tbluser) {
+	$fullname = '';
+	if ($tbluser->getUsStatus()<10) {
+      if (null==$tbluser->getUsLastname() && null==$tbluser->getUsFirstname())
+		  $fullname = '';        
+      else
+        $fullname = $tbluser->getUsLastname().' '.$tbluser->getUsFirstname();
+    } else {
+        $fullname = 'Äang bá» khÃ³a';
+    }
+
+    $result  = 'id='.$tbluser->getUsId();
+    $result .= '&username='.$tbluser->getUsUsername();
+    $result .= '&fullname='.$fullname;
+    $result .= '&gender='.($tbluser->getUsSex()==1? 'male': 'female');
+    $result .= '&email='.$tbluser->getUsEmail();
+    $result .= '&phone='.$tbluser->getUSPhone();
+    $result .= '&school='.$tbluser->getUsSchool();
+    $result .= '&province='.$tbluser->getUsProvince();
+    $result .= '&money='.$tbluser->getUsMoney();
+    return $result;
+  }
+
+  private function getPEncrypted($tbluser) {
+    $result  = 'pencrypted='.$tbluser->getUsPassword();
+    return $result;
+  }
+
+  private function getLicense($tbluser) {
+    $productId = $this->getRequestParameter('product');
+    $version = $this->getRequestParameter('version');
+    if ($productId == null) return;
+
+    $c = new Criteria();
+    $c->add(TblprolicensePeer::LI_TYPE, 1);
+    $c->add(TblprolicensePeer::LI_CUSTOMER, $tbluser->getUsId());
+    $c->add(TblprolicensePeer::LI_PRODUCT, $productId);
+    $c->add(TblprolicensePeer::LI_VERSION, $version, Criteria::GREATER_EQUAL);
+    $c->add(TblprolicensePeer::LI_EXPIREDATE, date('Y-m-d H:i:s'), Criteria::GREATER_EQUAL);
+    $license = TblprolicensePeer::doSelectOne($c);
+    $userdetail = TblblogcheckinfoPeer::retrieveByPk($tbluser->getUsId());
+    if ($license == null && $userdetail != null) {
+      $c = new Criteria();
+      $c->add(TblprolicensePeer::LI_TYPE, 2);
+      $c->add(TblprolicensePeer::LI_CUSTOMER, $userdetail->getCiSchool());
+      $c->add(TblprolicensePeer::LI_PRODUCT, $productId);
+      $c->add(TblprolicensePeer::LI_VERSION, $version, Criteria::GREATER_EQUAL);
+      $c->add(TblprolicensePeer::LI_EXPIREDATE, date('Y-m-d H:i:s'), Criteria::GREATER_EQUAL);
+      $license = TblprolicensePeer::doSelectOne($c);
+    }
+    return $license;
+  }
+
+  public function executeLogin() {
+    $src = $this->getRequestParameter('src');
+    $token = $this->getRequestParameter('token');
+    $account = $this->getRequestParameter('username');
+    $password = $this->getRequestParameter('password');		
+
+    if ($account == null || $password == null) return $this->renderText('status=1&errMsg=Not enough data');
+    if ($src == null || $token != md5($account.self::TOKENPW)) return $this->renderText('status=10');
+
+    $tbluser = $this->getUserField(TbluserPeer::US_USERNAME, $account);
+
+    if (!$tbluser) $tbluser = $this->getUserField(TbluserPeer::US_EMAIL, $account);
+    if (!$tbluser) $tbluser = $this->getUserField(TbluserPeer::US_PHONE, $account);
+    if (!$tbluser) return $this->renderText('status=2&errMsg=User not found');
+    if ($tbluser->getUsPassword() != md5($password)) return $this->renderText('status=3&errMsg=Incorrect password');
+
+    $loginResult = $this->getUserInfo($tbluser);
+    if ($tbluser->getUsStatus() == 0) return $this->renderText($loginResult.'&status=4&errMsg=Account is not activated');
+    
+	if ($license = $this->getLicense($tbluser)) {
+      $loginResult .= '&level='.$license->getLiLevel();
+      $ltype = $license->getLiType();
+      $cid = $license->getLiCustomer();
+      $customer = $ltype == 1? $tbluser->getUsFullname(): TblblogschoolsPeer::retrieveByPk($cid)->getScName();
+      $loginResult .= '&licType='.$ltype;
+      $loginResult .= '&licCustomer='.$customer;
+      $loginResult .= '&licCreate='.$license->getLiCreatedate('d/m/Y');
+      $loginResult .= '&licExpire='.$license->getLiExpiredate('d/m/Y');
+    }
+    else 
+		$loginResult .= '&level=0';
+
+    $loginResult .= '&status=0';
+
+    /*try {
+      $this->getUser()->signIn($tbluser);
+    } catch (Exception $e) {
+      return $this->renderText('&status=5&errMsg='.$e->getMessage());
+    }*/
+    $ip = myUtility::getRealIpAddr();
+    myUtility::log("$ip login from $src ($account)", 'apiuser.log');
+    return $this->renderText($loginResult);
+  }
+
+  public function executeLogout() {
+    $this->getUser()->signOut();
+    return sfView::NONE;
+  }
+
+  /*public function executeGetinfo() {
+    $src = $this->getRequestParameter('src');
+    $us_id = $this->getRequestParameter('us_id');
+    $uname = $this->getRequestParameter('username');
+    $email = $this->getRequestParameter('email');
+    $phone = $this->getRequestParameter('phone');
+    $token = $this->getRequestParameter('token');
+    if ($src == null) return sfView::NONE;
+
+    if ($us_id && $token==md5($us_id.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_ID, $us_id);
+    if ($uname && $token==md5($uname.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_USERNAME, $uname);
+    if ($email && $token==md5($email.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_EMAIL, $email);
+    if ($phone && $token==md5($phone.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_PHONE, $phone);
+
+    if ($tbluser) $result = $this->getUserInfo($tbluser);
+    else return sfView::NONE;
+
+    $ip = myUtility::getRealIpAddr();
+    myUtility::log("$ip get info from $src".($tbluser? ' ('.$tbluser->getUsUsername().')': ' failed'), 'apiuser.log');
+    return $this->renderText($result);
+  }*/
+
+  public function executeGetinfo() {
+    $src = $this->getRequestParameter('src');
+    $us_id = $this->getRequestParameter('us_id');
+    $uname = $this->getRequestParameter('username');
+    $email = $this->getRequestParameter('email');
+    $phone = $this->getRequestParameter('phone');
+    $token = $this->getRequestParameter('token');
+
+	$passwd_only = $this->getRequestParameter('ponly');
+
+    if ($src == null) return sfView::NONE;
+
+    if ($us_id && $token==md5($us_id.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_ID, $us_id);
+    if ($uname && $token==md5($uname.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_USERNAME, $uname);
+    if ($email && $token==md5($email.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_EMAIL, $email);
+    if ($phone && $token==md5($phone.self::TOKENPW)) $tbluser = $this->getUserField(TbluserPeer::US_PHONE, $phone);
+
+    if ($tbluser) 
+		$result = !$passwd_only ? $this->getUserInfo($tbluser) : $this->getPEncrypted($tbluser);
+    else return sfView::NONE;
+
+    $ip = myUtility::getRealIpAddr();
+    myUtility::log("$ip get info from $src".($tbluser? ' ('.$tbluser->getUsUsername().')': ' failed'), 'apiuser.log');
+    return $this->renderText($result);
+  }
+
+  public function executeUpdate() {
+    $src = $this->getRequestParameter('src');
+    $us_id = $this->getRequestParameter('us_id');
+    $username = $this->getRequestParameter('username');
+    $password = $this->getRequestParameter('password');
+    $fullname = $this->getRequestParameter('fullname'); 
+    $gender = $this->getRequestParameter('gender'); 
+    $email = $this->getRequestParameter('email');
+    $phone = $this->getRequestParameter('phone');
+    $school = $this->getRequestParameter('school');
+    $province = $this->getRequestParameter('province');
+    $token = $this->getRequestParameter('token');
+    $sendmail = $this->getRequestParameter('sendmail');
+    $oldpass = $this->getRequestParameter('oldpass');
+
+    if ($src == null) return $this->renderText('status=10');
+    //if ($this->validateData($fullname, $email, $phone, $error, false)) return $this->renderText('status=7&errMsg='.$error);
+	
+	if ($us_id == null) {      
+      if ($token != md5($username.self::TOKENPW)) return $this->renderText('status=10');
+      if (!$username || !$password /*|| !$fullname*/) return $this->renderText('status=1&errMsg=Not enough data');
+      if ($this->getUserField(TbluserPeer::US_USERNAME, $username)) return $this->renderText('status=2&errMsg=Username has existed');
+      if ($this->getUserField(TbluserPeer::US_EMAIL, $email)) return $this->renderText('status=3&errMsg=Email has existed');
+      if ($this->getUserField(TbluserPeer::US_PHONE, $phone)) return $this->renderText('status=4&errMsg=Phone number has existed');
+      
+	  $tbluser = new Tbluser();
+	  $tbluser->setUsRegisterdate(date('Y-m-d H:i:s'));
+      $tbluser->setUsScore(sfConfig::get('app_user_start_point'));  	  
+
+    } else {	  
+      if ($token != md5($us_id.self::TOKENPW)) return $this->renderText('status=10');
+      if ($username != null && $this->getUserField(TbluserPeer::US_USERNAME, $username, $us_id)) return $this->renderText('status=2&errMsg=Username has existed');
+      if ($email != null && $this->getUserField(TbluserPeer::US_EMAIL, $email, $us_id)) return $this->renderText('status=3&errMsg=Email has existed');
+      if ($phone != null && $this->getUserField(TbluserPeer::US_PHONE, $phone, $us_id)) return $this->renderText('status=4&errMsg=Phone number has existed');
+
+      $tbluser = TbluserPeer::retrieveByPK($us_id);
+      if ($tbluser == null) return $this->renderText('status=5&errMsg=User not found');	  
+      if (($username != null || $password != null) && md5($oldpass) != $tbluser->getUsPassword() && $src != 'SBG') return $this->renderText('status=6&errMsg=Incorrect old password');
+	  if ($oldpass != null && (md5($oldpass) != $tbluser->getUsPassword()) || $src != 'SBG') return $this->renderText('status=6&errMsg=Incorrect old password');
+      if ($email != null && $email != $tbluser->getUsEmail()) $tbluser->setEmailConfirm(0);
+      if ($phone != null && $phone != $tbluser->getUsPhone()) $tbluser->setMobileConfirm(0);
+    }
+
+    if ($username != null) $tbluser->setUsUsername($username);
+    if ($password != null) $tbluser->setUsPassword(md5($password));
+    if ($fullname != null) $tbluser->setUsFullname($fullname);
+    if ($gender != null) $tbluser->setUsSex($gender=='male'? 1: 2);
+    if ($email != null) $tbluser->setUsEmail($email);
+    if ($phone != null) $tbluser->setUsPhone($phone);
+    if ($school != null) $tbluser->setUsSchool($school);
+    if ($province != null) $tbluser->setUsProvince($province);
+
+	$tbluser->save();
+
+	if ($sendmail == 'true') userMessage::sendConfirmEmail($tbluser, $password);
+    $ip = myUtility::getRealIpAddr();
+    $act = ($us_id == null? 'create': 'update');
+    myUtility::log("$ip $act from $src".($tbluser? ' ('.$tbluser->getUsUsername().')': ' failed'), 'apiuser.log');
+    return $this->renderText('status=0&id='.$tbluser->getUsId());
+  }
+
+  public function executeForgotpassword() {
+    $src = $this->getRequestParameter('src');
+    $email = $this->getRequestParameter('email');
+    $token = $this->getRequestParameter('token');
+    if ($src != null && $email != null && $token == md5($email.self::TOKENPW)) {
+      $c = new Criteria();
+      $c->add(TbluserPeer::US_EMAIL, trim($email));
+      $tbluser = TbluserPeer::doSelectOne($c);
+      if ($tbluser != null) {
+        $res = userMessage::sendForgotPassEmail($tbluser);
+        $ip = myUtility::getRealIpAddr();
+        $acc = $tbluser->getUsUsername();
+        myUtility::log("$ip from $src get password ($acc)".($res?'':' failed'), 'apiuser.log');
+        return $this->renderText('status=0');
+      }
+      return $this->renderText('status=1&errMsg=Email not found');
+    }
+    return $this->renderText('status=10');
+  }
+
+  public function executeGetonlineuser() {
+    return sfView::NONE;
+  }
+
+  public function executeGetprice() {
+    $products = $this->getRequestParameter('product');
+    $products = explode(',', $products);
+    $result = '';
+    foreach ($products as $product) {
+      $c = new Criteria();
+      $c->add(TblproductPeer::PRO_NAME, $product);
+      $tblprod = TblproductPeer::doSelectOne($c);
+      if ($tblprod) $result .= '&'.$product.'='.$tblprod->getProPrice();
+    }
+    return $this->renderText($result);
+  }
+
+  public function executePayment() {
+    $src = $this->getRequestParameter('src');
+    $us_id = $this->getRequestParameter('us_id');
+    $product = $this->getRequestParameter('product');
+    $token = $this->getRequestParameter('token');
+    if ($src == null || $token != md5($us_id.self::TOKENPW)) return $this->renderText('status=10');
+
+    $c = new Criteria();
+    $c->add(TblproductPeer::PRO_NAME, $product);
+    $tblprod = TblproductPeer::doSelectOne($c);
+    $price = $tblprod->getProPrice();
+
+    $tbluser = TbluserPeer::retrieveByPk($us_id);
+    if ($tbluser == null) return $this->renderText('status=1&errMsg=User not found');
+    if ($tbluser->getUsMoney() < $price) return $this->renderText('status=2&errMsg=Not enough money');
+    $tbluser->doTransaction(-$price, 'pay', $product);
+
+    if ($tblprod->getProType() > 0) {
+      if ($tbllic = $tblprod->getUserLicense($us_id)) {
+        $exp = $tbllic->getLiExpiredate();
+        $start = strtotime($exp) > time()? $exp: date('Y-m-d H:i:s');
+        $tbllic->setLiExpiredate(date('Y-m-d H:i:s', strtotime($start.' + 1 year')));
+        $tbllic->save();
+      } else {
+        $tblprod->createUserLicense($us_id, 1);
+      }
+    }
+    $ip = myUtility::getRealIpAddr();
+    $acc = $tbluser->getUsUsername();
+    myUtility::log("$ip pay $price from $src ($acc)", 'apiuser.log');
+    return $this->renderText('status=0&price='.$price.'&money='.$tbluser->getUsMoney());
+  }
+
+  public function executeActivate() {
+    $arParams['access_key']   = $this->getRequestParameter('access_key', 'no_access_key');
+    $arParams['command']      = $this->getRequestParameter('command', 'no_command');
+    $arParams['mo_message']   = $this->getRequestParameter('mo_message', 'no_mo_message');
+    $arParams['msisdn']       = $this->getRequestParameter('msisdn', 'no_msisdn');
+    $arParams['request_id']   = $this->getRequestParameter('request_id', 'no_request_id');
+    $arParams['request_time'] = $this->getRequestParameter('request_time', 'no_request_time');
+    $arParams['short_code']   = $this->getRequestParameter('short_code', 'no_short_code');
+    $arParams['signature']    = $this->getRequestParameter('signature', 'no_signature');
+
+    $data  = "access_key=" . $arParams['access_key'] . "&command=" . $arParams['command'] . "&mo_message=" . $arParams['mo_message'] . "&msisdn=" . $arParams['msisdn'];
+    $data .= "&request_id=" . $arParams['request_id'] . "&request_time=" . $arParams['request_time'] . "&short_code=" . $arParams['short_code'];
+    $secret = 'evvx931itxysfnp9m94rf2vxd101zegr';
+    $signature = hash_hmac("sha256", $data, $secret);
+
+    $smsPrice = array('80'=>500, '81'=>1000, '82'=>2000, '83'=>3000, '84'=>4000, '85'=>5000, '86'=>10000, '87'=>15000);
+    $money = @$smsPrice[substr($arParams['short_code'], 0, 2)];
+
+    if ($arParams['signature'] == $signature) {
+      $phone = preg_replace('/^84/', '0', $arParams['msisdn']);
+      preg_match('/^nc +(\w+) *(\d*)/i', $arParams['mo_message'], $match);
+      $key = strtolower(@$match[1]);
+      $uid = @$match[2];
+      $findid = ($key == 'nt' && is_numeric($uid));
+      if ($findid) $tbluser = TbluserPeer::retrieveByPk($uid);
+      else $tbluser = $this->getUserField(TbluserPeer::US_PHONE, $phone);
+
+      if ($tbluser != null) {
+        switch ($key) {
+        case 'kh':
+          if ($tbluser->getMobileConfirm() == 0) {
+            $tbluser->setUsScore($tbluser->getUsScore() + sfConfig::get('app_user_activate_point'));
+            $tbluser->setMobileConfirm(1);
+            $tbluser->save();
+            $arResponse['sms'] = 'Kich hoat thanh cong tai khoan '.$tbluser->getUsUsername();
+          } else {
+            $arResponse['sms'] = 'Tai khoan '.$tbluser->getUsUsername().' da duoc kich hoat';
+          }
+          break;
+        case 'mk':
+          $passwd = myUtility::create_password();
+          $tbluser->setUsPassword(md5($passwd));
+          $tbluser->setMobileConfirm(1);
+          $tbluser->save();
+          $arResponse['sms'] = 'Tai khoan Violet.vn, ten truy nhap: '.$tbluser->getUsUsername().', mat khau: '.$passwd;
+          break;
+        case 'nt':
+          $tbluser->doTransaction($money, 'sms', $phone);
+          $arResponse['sms'] = 'Tai khoan '.$tbluser->getUsUsername().' da duoc nap them '.$money.' dong, hien dang co '.$tbluser->getUsMoney().' dong';
+          break;
+        default:
+          $arResponse['sms'] = 'Tin nhan cua quy vi khong dung cu phap cua Violet.vn';
+        }
+      } else {
+        $arResponse['sms'] = 'Khong tim thay tai khoan nao co '.($findid? ('id '.$uid): ('so dien thoai '.$phone)).' tren Violet.vn';
+      }
+    } else {
+      $arResponse['sms'] = 'Sai chu ky';
+    }
+
+    $arResponse['status'] = 1;
+    $arResponse['type'] = 'text';
+    myUtility::log($arParams['msisdn'].': '.$arParams['mo_message'].' -> '.$arParams['short_code'].' | '.$arResponse['sms'], 'sms.log');
+    return $this->renderText(json_encode($arResponse));
+  }
+
+  private function execPostRequest($url, $data){ 
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL, $url);
+    curl_setopt($ch, CURLOPT_POST, 1);
+    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);	
+    curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    $result = curl_exec($ch);	 
+    curl_close($ch);
+    return $result;
+  }
+
+  public function executeCardcharge() {
+    $src = $this->getRequestParameter('src');
+    $us_id = $this->getRequestParameter('us_id');
+    $token = $this->getRequestParameter('token');
+    if ($src == null || $token != md5($us_id.self::TOKENPW)) return $this->renderText('status=10');
+
+    $tbluser = TbluserPeer::retrieveByPk($us_id);
+    if ($tbluser == null) return $this->renderText('status=5&errMsg=User not found');
+
+    $access_key = 'in3je3d6lxh8zx8m68ox';
+    $secret = 'evvx931itxysfnp9m94rf2vxd101zegr';
+    $type = $this->getRequestParameter('type');
+    $pin = $this->getRequestParameter('pin');
+    $serial = $this->getRequestParameter('serial');
+
+    $data = "access_key=".$access_key."&pin=".$pin."&serial=".$serial."&type=".$type;
+    $signature = hash_hmac("sha256", $data, $secret);
+    $data .= "&signature=".$signature;
+    $res = json_decode($this->execPostRequest('https://api.1pay.vn/card-charging/v2/topup', $data));
+    $status = (int)$res->status;
+    $amount = (int)$res->amount;
+    $desc = $res->description;
+
+    if ($status == 0) $tbluser->doTransaction($amount*2, 'card', $serial);
+    $ip = myUtility::getRealIpAddr();
+    myUtility::log("$ip load $type $serial (pin $pin) from $src: ".($status==0? $amount.'VND': $desc), 'card.log');
+    return $this->renderText('status='.$status.'&amount='.$amount.'&money='.$tbluser->getUsMoney().'&errMsg='.$desc);
+  }
+}
+
+?>
Index: pro-violet-viettel/www/deploy/api/platform/templates/layout.php
===================================================================
--- pro-violet-viettel/www/deploy/api/platform/templates/layout.php	(revision 784)
+++ pro-violet-viettel/www/deploy/api/platform/templates/layout.php	(revision 784)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+
+<?php include_http_metas() ?>
+<?php include_metas() ?>
+
+<?php include_title() ?>
+
+</head>
+<body>
+
+<?php echo $sf_data->getRaw('sf_content') ?>
+
+</body>
+</html>
Index: pro-violet-viettel/www/deploy/api/route-eth1
===================================================================
--- pro-violet-viettel/www/deploy/api/route-eth1	(revision 783)
+++ 	(revision )
@@ -1,25 +1,0 @@
-192.168.181.186/32 via 10.58.38.254 dev eth1
-10.61.75.80/32 via 10.58.38.254 dev eth1
-10.61.75.81/32 via 10.58.38.254 dev eth1
-10.61.75.82/32 via 10.58.38.254 dev eth1
-10.61.75.83/32 via 10.58.38.254 dev eth1
-10.61.75.84/32 via 10.58.38.254 dev eth1
-10.61.75.85/32 via 10.58.38.254 dev eth1
-10.61.75.86/32 via 10.58.38.254 dev eth1
-10.61.75.87/32 via 10.58.38.254 dev eth1
-10.61.75.88/32 via 10.58.38.254 dev eth1
-10.61.75.89/32 via 10.58.38.254 dev eth1
-10.61.75.90/32 via 10.58.38.254 dev eth1
-10.58.46.141/32 via 10.58.38.254 dev eth1
-10.58.46.147/32 via 10.58.38.254 dev eth1
-10.58.46.148/32 via 10.58.38.254 dev eth1
-10.58.46.166/32 via 10.58.38.254 dev eth1
-10.58.46.168/32 via 10.58.38.254 dev eth1
-10.56.128.12/32 via 10.58.38.254 dev eth1
-10.56.128.13/32 via 10.58.38.254 dev eth1
-10.56.128.18/32 via 10.58.38.254 dev eth1
-10.60.32.252/32 via 10.58.38.254 dev eth1
-10.60.32.154/32 via 10.58.38.254 dev eth1
-10.60.32.153/32 via 10.58.38.254 dev eth1
-10.60.32.156/32 via 10.58.38.254 dev eth1
-10.58.4.77/32 via 10.58.38.254 dev eth1
Index: pro-violet-viettel/www/deploy/api/tracetcp.sh
===================================================================
--- pro-violet-viettel/www/deploy/api/tracetcp.sh	(revision 783)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#!/bin/bash
-echo "192.168.181.186:80"
-tcptraceroute -nT -p 80 192.168.181.186
-echo ""
-echo "192.168.181.186:7777"
-tcptraceroute -nT -p 7777 192.168.181.186
-echo ""
-echo "10.60.32.252:6068"
-tcptraceroute -nT -p 6068 10.60.32.252
-echo ""
-echo "10.60.32.154:6068"
-tcptraceroute -nT -p 6068 10.60.32.154
-echo ""
-echo "10.60.32.153:6068"
-tcptraceroute -nT -p 6068 10.60.32.153
-echo ""
-echo "10.60.32.156:6068"
-tcptraceroute -nT -p 6068 10.60.32.156
-echo ""
-echo "10.60.32.154:8101"
-tcptraceroute -nT -p 8101 10.60.32.154
-echo "All Done!"
Index: pro-violet-viettel/www/deploy/api/upload.log
===================================================================
--- pro-violet-viettel/www/deploy/api/upload.log	(revision 783)
+++ 	(revision )
@@ -1,8 +1,0 @@
-false
-name: Koala.jpg
-size: 780831
-false
-name: Koala.jpg
-size: 780831
-error: 
-true
