Handle a given active button based on the hash (classname in sha1).

@param string $hash The hash name, equals to the class name of the button
@return array|boolean Returns the button array response or false if not found.
@since 1.2.3
975949
public function handleNgRestActiveButton($hash)
    {
        foreach ($this->ngRestActiveButtons() as $item) {
            if (sha1($item['class']) == $hash) {
                $button = Yii::createObject($item);
                return $button->handle($this);
            }
        }

        return false;
    }
1181672
public function getDataFromHash($hash)
	{
		$data   = [];
		$fields = $this->fields[$hash];
		foreach ($fields as $source => $ids)
		{
			$result  = [];
			$results = $this->results[$source];
			foreach ($ids as $id)
			{
				$result[$id] = $results[$id];
			}
			$data[$source] = $result;
		}

		return $data;
	}
592854
public function getPasswordRequestData($hash) 
    {
        $table = $this->getServiceLocator()->get('MelisLostPasswordTable');
        $data = $table->getEntryByField('rh_hash', $hash);
        
        if($data) 
            return $data;
    }
1356199
public function urlHash($hash = null, $withHash = true)
    {
        if ($hash) {
            $this->set('urlHash', ltrim($hash, '#'));
        }

        $hash = $this->get('urlHash', '');

        return $withHash && !empty($hash) ? '#' . $hash : $hash;
    }
526938
public function get(string $key, string $hash = '')
    {
        if (!$key && $hash) {
            $wp_using_ext_object_cache            = wp_using_ext_object_cache(false);
            $key                                  = $this->hashToKey($hash);
            $do_restore_wp_using_ext_object_cache = true; // See below.
        }
        if ($this->App->Config->§specs['§is_network_wide'] && $this->Wp->is_multisite) {
            $value = get_site_transient($this->App->Config->©brand['©var'].'_'.$key);
        } else {
            $value = get_transient($this->App->Config->©brand['©var'].'_'.$key);
        }
        if (!empty($do_restore_wp_using_ext_object_cache)) {
            wp_using_ext_object_cache($wp_using_ext_object_cache);
        }
        return $value === false ? null : $value;
    }
830123
public static function getToken($hash = 'md5')
    {
        return hash(
            $hash,
            (array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : null)
            .uniqid(mt_rand())
        );
    }
1265069
public function ls($hash) {
		if (($dir = $this->dir($hash)) == false || !$dir['read']) {
			return false;
		}
		
		$list = array();
		$path = $this->decode($hash);
		
		foreach ($this->getScandir($path) as $stat) {
			if (empty($stat['hidden']) && $this->mimeAccepted($stat['mime'])) {
				$list[] = $stat['name'];
			}
		}

		return $list;
	}
890805
public function realpath($hash)	{
		if (($volume = $this->volume($hash)) == false) {
			return false;
		}
		return $volume->realpath($hash);
	}
459266
public function getInfo($hash) {
    $regex_pattern = '/^\$[a-z, 1-6]{1,6}\$/i';
    preg_match($regex_pattern, $hash, $matches);

    if(sizeof($matches) > 0) {
      list($method) = $matches;
    } else {
      $method = null;
    }

    switch($method) {
      case self::SHA256:
      case self::SHA512:
      case self::PBKDF2:
        $param = array();
        list( , , $params) = explode('$', $hash);
        parse_str($params, $param);
        $info['options'] = $param;
      break;

      case self::BCRYPT;
        list( , , $cost) = explode('$', $hash);
        $info['options'] = array(
          'cost' => $cost,
        );
      break;
    }
    $info['algo'] = $method;
    return $info;
  }
65726
private function hash_to_key($hash)
     {
        if (array_key_exists($hash, $this->map_hash_to_key)) {
            return $this->map_hash_to_key[$hash];
        } else {
            throw new \OutOfBoundsException(sprintf(
                'Hash "%s" has not been created',
                $hash
            ));
        }
     }
53417
protected function setHashingAndSave($hash)
    {
        // Set hashing state
        $hashing = $this->getHashing();
        $this->setHashing($hash);

        // Save the model
        $result = $this->save();

        // Reset hashing back to it's previous state
        $this->setHashing($hashing);

        return $result;
    }
700788
public function checkSession($hash)
    {
        $ip = $this->getIp();
        $block_status = $this->isBlocked();

        if ($block_status == "block") {
            $return['message'] = $this->__lang("user_blocked");
            return false;
        }

        if (strlen($hash) != self::HASH_LENGTH) {
            return false;
        }

        // INET_NTOA(ip)
        $query = "SELECT id, uid, expiredate, ip, agent, cookie_crc FROM {$this->config->table_sessions} WHERE hash = :hash";
        $query_prepared = $this->dbh->prepare($query);
        $query_params = [
            'hash' => $hash
        ];
        $query_prepared->execute($query_params);

        if ($query_prepared->rowCount() == 0) {
            return false;
        }

        $row = $query_prepared->fetch(\PDO::FETCH_ASSOC);

        $uid = $row['uid'];
        $expiredate = strtotime($row['expiredate']);
        $currentdate = strtotime(date("Y-m-d H:i:s"));
        $db_ip = $row['ip'];
        $db_cookie = $row['cookie_crc'];

        if ($currentdate > $expiredate) {
            $this->deleteSession($hash);

            return false;
        }

        if ($ip != $db_ip) {
            return false;
        }

        if ($db_cookie == sha1($hash . $this->config->site_key)) {
            if ($expiredate - $currentdate < strtotime($this->config->cookie_renew) - $currentdate) {
                $this->deleteSession($hash);
                $this->addSession($uid, false);
            }
            return true;
        }

        return false;
    }
285659
public function editAction( $hash = NULL )
    {
        $address = $this->addressRepository->findOneByRegisteraddresshashIgnoreHidden($hash);

        if ($address) {
            $this->view->assign('hash', $hash);
            $this->view->assign('address', $address);
        }
    }
834588
public function file($hash) {
		$path = $this->decode($hash);
		
		return ($file = $this->stat($path)) ? $file : $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
	}
928062
public function rename($hash, $name) {
		if ($this->commandDisabled('rename')) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}
		
		if (!$this->nameAccepted($name)) {
			return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
		}
		
		if (!($file = $this->file($hash))) {
			return $this->setError(elFinder::ERROR_FILE_NOT_FOUND);
		}
		
		if ($name == $file['name']) {
			return $file;
		}
		
		if (!empty($file['locked'])) {
			return $this->setError(elFinder::ERROR_LOCKED, $file['name']);
		}
		
		$path = $this->decode($hash);
		$dir  = $this->dirnameCE($path);
		$stat = $this->stat($this->joinPathCE($dir, $name));
		if ($stat) {
			return $this->setError(elFinder::ERROR_EXISTS, $name);
		}
		
		if (!$this->allowCreate($dir, $name, ($file['mime'] === 'directory'))) {
			return $this->setError(elFinder::ERROR_PERM_DENIED);
		}

		$this->rmTmb($file); // remove old name tmbs, we cannot do this after dir move


		if ($path = $this->convEncOut($this->_move($this->convEncIn($path), $this->convEncIn($dir), $this->convEncIn($name)))) {
			$this->clearcache();
			return $this->stat($path);
		}
		return false;
	}
20901
public function showCommit($hash)
    {
        /** @var $result CallResult */
        $result = $this->getGit()->{'show'}($this->getRepositoryPath(), array(
            '--format' => 'fuller',
            $hash
        ));
        $result->assertSuccess(sprintf('Cannot retrieve commit "%s" from "%s"',
            $hash, $this->getRepositoryPath()
        ));

        return $result->getStdOut();
    }
609655
public function getSessionUID($hash)
    {
        $query = "SELECT uid FROM {$this->config->table_sessions} WHERE hash = :hash";
        $query_prepared = $this->dbh->prepare($query);
        $query_params = [
            'hash' => $hash
        ];
        $query_prepared->execute($query_params);

        if ($query_prepared->rowCount() == 0) {
            return false;
        }

        return $query_prepared->fetch(\PDO::FETCH_ASSOC)['uid'];
    }