Example #1
0
 public static function lock($cid, $ctype)
 {
     // try to get user
     if (!($user = Pimcore_Tool_Admin::getCurrentUser())) {
         return false;
     }
     $lock = new self();
     $lock->setCid($cid);
     $lock->setCtype($ctype);
     $lock->setDate(time());
     $lock->setUserId($user->getId());
     $lock->setSessionId(session_id());
     $lock->save();
     return $lock;
 }
Example #2
0
 public static function lock($cid, $ctype)
 {
     // try to get user
     try {
         $user = Zend_Registry::get("pimcore_admin_user");
     } catch (Exception $e) {
         return false;
     }
     $lock = new self();
     $lock->setCid($cid);
     $lock->setCtype($ctype);
     $lock->setDate(time());
     $lock->setUserId($user->getId());
     $lock->setSessionId(session_id());
     $lock->save();
     return $lock;
 }