예제 #1
0
 /**
  * Dump ssh keys into gitolite conf
  */
 public function dumpSSHKeys(User $user = null)
 {
     if (is_dir($this->getAdminPath())) {
         if ($user) {
             $this->initUserKeys($user);
             $commit_msg = 'Update ' . $user->getUserName() . ' (Id: ' . $user->getId() . ') SSH keys';
         } else {
             $userdao = new UserDao();
             foreach ($userdao->searchSSHKeys() as $row) {
                 $user = new User($row);
                 $this->initUserKeys($user);
             }
             $commit_msg = 'SystemEvent update all user keys';
         }
         $this->gitExec->add('keydir');
         $this->gitExec->commit($commit_msg);
         return $this->push();
     }
     return false;
 }
예제 #2
0
 /**
  * Dump ssh keys into gitolite conf
  */
 public function dumpSSHKeys()
 {
     if (is_dir($this->getAdminPath())) {
         $userdao = new UserDao(CodendiDataAccess::instance());
         foreach ($userdao->searchSSHKeys() as $row) {
             $user = new User($row);
             $this->initUserKeys($user);
         }
         return $this->push();
     }
     return false;
 }
예제 #3
0
 /**
  * dumps SSH authorized_keys into all users homedirs
  * 
  * @return boolean always true
  */
 public function dumpSSHKeys()
 {
     $user_dao = new UserDao();
     $user_manager = $this->getUserManager();
     foreach ($user_dao->searchSSHKeys() as $row) {
         $this->writeSSHKeys($user_manager->getUserInstanceFromRow($row));
     }
     EventManager::instance()->processEvent(Event::DUMP_SSH_KEYS, null);
     return true;
 }