/usr
/local
/vufind
/themes
/bootstrap3
/templates
/Auth
/AbstractBase
/login.phtml
<div class="text-center" style="margin: 28px 41px 28px 35px;width: auto;padding: 4px 0; cursor: pointer;border: 1px solid #e5e5e5; border-radius: 5px !important;background-image: -moz-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);background-image: -webkit-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);background-image: -ms-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);">
<a href="https://giris.turkiye.gov.tr/OAuth2AuthorizationServer/AuthorizationController?response_type=code&client_id=3bc61f1a-0a8a-429d-93b9-abfc7d4a6084&state=5de5e2891ae59&scope=Ad-Soyad;Temel-Bilgileri;Iletisim-Bilgileri;Adres-Bilgileri&redirect_uri=https://kutuphane.tarimorman.gov.tr/auth_check"><img src="https://kutuphane.tarimorman.gov.tr/img/e-devlet.png"></a>
</div>
<?php $name = 'vu_ref';
$value = $_SERVER['HTTP_REFERER'];
$expirationTime = 0; $path = '/';
$domain = 'kutuphane.tarimorman.gov.tr';
$isSecure = true;
$isHttpOnly = true;
setcookie($name, $value, $expirationTime, $path, $domain, $isSecure, $isHttpOnly);?>
/usr
/local
/vufind
/themes
/bootstrap3
/templates
/Auth
/AbstractBase
/login.phtml
<div class="text-center" style="margin: 28px 41px 28px 35px;width: auto;padding: 4px 0; cursor: pointer;border: 1px solid #e5e5e5; border-radius: 5px !important;background-image: -moz-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);background-image: -webkit-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);background-image: -ms-linear-gradient(90deg, #c6c6c6 0%, #ffffff 100%);">
<a href="https://giris.turkiye.gov.tr/OAuth2AuthorizationServer/AuthorizationController?response_type=code&client_id=3bc61f1a-0a8a-429d-93b9-abfc7d4a6084&state=5de5e2891ae59&scope=Ad-Soyad;Temel-Bilgileri;Iletisim-Bilgileri;Adres-Bilgileri&redirect_uri=https://kutuphane.tarimorman.gov.tr/auth_check"><img src="https://kutuphane.tarimorman.gov.tr/img/e-devlet.png"></a>
</div>
<?php $name = 'vu_ref';
$value = $_SERVER['HTTP_REFERER'];
$expirationTime = 0; $path = '/';
$domain = 'kutuphane.tarimorman.gov.tr';
$isSecure = true;
$isHttpOnly = true;
setcookie($name, $value, $expirationTime, $path, $domain, $isSecure, $isHttpOnly);?>
/usr
/local
/vufind
/vendor
/zendframework
/zend-view
/src
/Renderer
/PhpRenderer.php
$__vars = $this->vars()->getArrayCopy();
if (array_key_exists('this', $__vars)) {
unset($__vars['this']);
}
extract($__vars);
unset($__vars); // remove $__vars from local scope
$this->__content = '';
while ($this->__template = array_pop($this->__templates)) {
$this->__file = $this->resolver($this->__template);
if (! $this->__file) {
throw new Exception\RuntimeException(sprintf(
'%s: Unable to render template "%s"; resolver could not resolve to a file',
__METHOD__,
$this->__template
));
}
try {
ob_start();
$includeReturn = include $this->__file;
$this->__content = ob_get_clean();
} catch (\Throwable $ex) {
ob_end_clean();
throw $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
ob_end_clean();
throw $ex;
}
if ($includeReturn === false && empty($this->__content)) {
throw new Exception\UnexpectedValueException(sprintf(
'%s: Unable to render template "%s"; file include failed',
__METHOD__,
$this->__file
));
}
}
$this->setVars(array_pop($this->__varsCache));
if ($this->__filterChain instanceof FilterChain) {
/usr
/local
/vufind
/module
/VuFind
/src
/VuFind
/View
/Helper
/Root
/AbstractClassBasedTemplateRenderer.php
/**
* Recursively locate and render a template that matches the provided class
* name (or one of its parent classes); throw an exception if no match is
* found.
*
* @param string $template Template path (with %s as class name placeholder)
* @param string $className Name of class to apply to template.
* @param string $topClassName Top-level parent class of $className (or null
* if $className is already the top level; used for recursion only).
*
* @return string
* @throws RuntimeException
*/
protected function resolveClassTemplate($template, $className,
$topClassName = null
) {
// If the template resolves, we can render it!
$templateWithClass = sprintf($template, $this->getBriefClass($className));
if ($this->getView()->resolver()->resolve($templateWithClass)) {
return $this->getView()->render($templateWithClass);
}
// If the template doesn't resolve, let's see if we can inherit a
// template from a parent class:
$parentClass = get_parent_class($className);
if (empty($parentClass)) {
// No more parent classes left to try? Throw an exception!
throw new RuntimeException(
'Cannot find ' . $templateWithClass . ' template for class: '
. ($topClassName ?? $className)
);
}
// Recurse until we find a template or run out of parents...
return $this->resolveClassTemplate(
$template, $parentClass, $topClassName ?? $className
);
}
/**
/usr
/local
/vufind
/module
/VuFind
/src
/VuFind
/View
/Helper
/Root
/AbstractClassBasedTemplateRenderer.php
// If the template resolves, we can render it!
$templateWithClass = sprintf($template, $this->getBriefClass($className));
if ($this->getView()->resolver()->resolve($templateWithClass)) {
return $this->getView()->render($templateWithClass);
}
// If the template doesn't resolve, let's see if we can inherit a
// template from a parent class:
$parentClass = get_parent_class($className);
if (empty($parentClass)) {
// No more parent classes left to try? Throw an exception!
throw new RuntimeException(
'Cannot find ' . $templateWithClass . ' template for class: '
. ($topClassName ?? $className)
);
}
// Recurse until we find a template or run out of parents...
return $this->resolveClassTemplate(
$template, $parentClass, $topClassName ?? $className
);
}
/**
* Render a template associated with the provided class name, applying to
* specified context variables.
*
* @param string $template Template path (with %s as class name placeholder)
* @param string $className Name of class to apply to template.
* @param array $context Context for rendering template
*
* @return string
*/
protected function renderClassTemplate($template, $className, $context = [])
{
// Set up the needed context in the view:
$contextHelper = $this->getView()->plugin('context');
$oldContext = $contextHelper($this->getView())->apply($context);
// Render the template for the current class:
/usr
/local
/vufind
/module
/VuFind
/src
/VuFind
/View
/Helper
/Root
/AbstractClassBasedTemplateRenderer.php
}
/**
* Render a template associated with the provided class name, applying to
* specified context variables.
*
* @param string $template Template path (with %s as class name placeholder)
* @param string $className Name of class to apply to template.
* @param array $context Context for rendering template
*
* @return string
*/
protected function renderClassTemplate($template, $className, $context = [])
{
// Set up the needed context in the view:
$contextHelper = $this->getView()->plugin('context');
$oldContext = $contextHelper($this->getView())->apply($context);
// Render the template for the current class:
$html = $this->resolveClassTemplate($template, $className);
// Restore the original context before returning the result:
$contextHelper($this->getView())->restore($oldContext);
return $html;
}
/**
* Helper to grab the end of the class name
*
* @param string $className Class name to abbreviate
*
* @return string
*/
protected function getBriefClass($className)
{
$classParts = explode('\\', $className);
return array_pop($classParts);
}
}
/usr
/local
/vufind
/module
/VuFind
/src
/VuFind
/View
/Helper
/Root
/Auth.php
) {
$this->manager = $manager;
$this->ilsAuthenticator = $ilsAuthenticator;
}
/**
* Render a template within an auth module folder.
*
* @param string $name Template name to render
* @param array $context Context for rendering template
*
* @return string
*/
protected function renderTemplate($name, $context = [])
{
// Get the current auth module's class name
$className = $this->getManager()->getAuthClassForTemplateRendering();
$template = 'Auth/%s/' . $name;
$context['topClass'] = $this->getBriefClass($className);
return $this->renderClassTemplate($template, $className, $context);
}
/**
* Get manager
*
* @return \VuFind\Auth\Manager
*/
public function getManager()
{
return $this->manager;
}
/**
* Checks whether the user is logged in.
*
* @return \VuFind\Db\Row\User|bool Object if user is logged in, false
* otherwise.
*/
public function isLoggedIn()
{
/usr
/local
/vufind
/module
/VuFind
/src
/VuFind
/View
/Helper
/Root
/Auth.php
*
* @param array $context Context for rendering template
*
* @return string
*/
public function getLoginFields($context = [])
{
return $this->renderTemplate('loginfields.phtml', $context);
}
/**
* Render the login template.
*
* @param array $context Context for rendering template
*
* @return string
*/
public function getLogin($context = [])
{
return $this->renderTemplate('login.phtml', $context);
}
/**
* Render the login description template.
*
* @param array $context Context for rendering template
*
* @return string
*/
public function getLoginDesc($context = [])
{
return $this->renderTemplate('logindesc.phtml', $context);
}
/**
* Render the new password form template.
*
* @param array $context Context for rendering template
*
* @return string
/usr
/local
/vufind
/themes
/bootstrap3
/templates
/myresearch
/login.phtml
// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Login') . '</li>';
// Convenience variables:
$account = $this->auth()->getManager();
$hideLogin = !(is_object($account) && $account->loginEnabled());
$offlineMode = $this->ils()->getOfflineMode();
?>
<?php if ($offlineMode == "ils-offline"): ?>
<?=$this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_login_message'])?>
<?php endif; ?>
<h2 class="lightbox-header"><?=$this->transEsc('Login')?></h2>
<?=$this->flashmessages()?>
<?php if ($hideLogin): ?>
<div class="alert alert-danger"><?=$this->transEsc('login_disabled')?></div>
<?php else: ?>
<?=$this->auth()->getLogin()?>
<?php endif; ?>
/usr
/local
/vufind
/vendor
/zendframework
/zend-view
/src
/Renderer
/PhpRenderer.php
$__vars = $this->vars()->getArrayCopy();
if (array_key_exists('this', $__vars)) {
unset($__vars['this']);
}
extract($__vars);
unset($__vars); // remove $__vars from local scope
$this->__content = '';
while ($this->__template = array_pop($this->__templates)) {
$this->__file = $this->resolver($this->__template);
if (! $this->__file) {
throw new Exception\RuntimeException(sprintf(
'%s: Unable to render template "%s"; resolver could not resolve to a file',
__METHOD__,
$this->__template
));
}
try {
ob_start();
$includeReturn = include $this->__file;
$this->__content = ob_get_clean();
} catch (\Throwable $ex) {
ob_end_clean();
throw $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
ob_end_clean();
throw $ex;
}
if ($includeReturn === false && empty($this->__content)) {
throw new Exception\UnexpectedValueException(sprintf(
'%s: Unable to render template "%s"; file include failed',
__METHOD__,
$this->__file
));
}
}
$this->setVars(array_pop($this->__varsCache));
if ($this->__filterChain instanceof FilterChain) {
/usr
/local
/vufind
/vendor
/zendframework
/zend-view
/src
/View.php
// If EVENT_RENDERER or EVENT_RENDERER_POST changed the model, make sure
// we use this new model instead of the current $model
$model = $event->getModel();
// If we have children, render them first, but only if:
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
if ($model->hasChildren()
&& (! $renderer instanceof TreeRendererInterface
|| ! $renderer->canRenderTrees())
) {
$this->renderChildren($model);
}
// Reset the model, in case it has changed, and set the renderer
$event->setModel($model);
$event->setRenderer($renderer);
$rendered = $renderer->render($model);
// If this is a child model, return the rendered content; do not
// invoke the response strategy.
$options = $model->getOptions();
if (array_key_exists('has_parent', $options) && $options['has_parent']) {
return $rendered;
}
$event->setResult($rendered);
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/**
* Loop through children, rendering each
*
* @param Model $model
* @throws Exception\DomainException
* @return void
/usr
/local
/vufind
/vendor
/zendframework
/zend-view
/src
/View.php
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/**
* Loop through children, rendering each
*
* @param Model $model
* @throws Exception\DomainException
* @return void
*/
protected function renderChildren(Model $model)
{
foreach ($model as $child) {
if ($child->terminate()) {
throw new Exception\DomainException('Inconsistent state; child view model is marked as terminal');
}
$child->setOption('has_parent', true);
$result = $this->render($child);
$child->setOption('has_parent', null);
$capture = $child->captureTo();
if (! empty($capture)) {
if ($child->isAppend()) {
$oldResult = $model->{$capture};
$model->setVariable($capture, $oldResult . $result);
} else {
$model->setVariable($capture, $result);
}
}
}
}
/**
* Create and return ViewEvent used by render()
*
* @return ViewEvent
*/
protected function getEvent()
{
/usr
/local
/vufind
/vendor
/zendframework
/zend-view
/src
/View.php
__METHOD__
));
}
$event->setRenderer($renderer);
$event->setName(ViewEvent::EVENT_RENDERER_POST);
$events->triggerEvent($event);
// If EVENT_RENDERER or EVENT_RENDERER_POST changed the model, make sure
// we use this new model instead of the current $model
$model = $event->getModel();
// If we have children, render them first, but only if:
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
if ($model->hasChildren()
&& (! $renderer instanceof TreeRendererInterface
|| ! $renderer->canRenderTrees())
) {
$this->renderChildren($model);
}
// Reset the model, in case it has changed, and set the renderer
$event->setModel($model);
$event->setRenderer($renderer);
$rendered = $renderer->render($model);
// If this is a child model, return the rendered content; do not
// invoke the response strategy.
$options = $model->getOptions();
if (array_key_exists('has_parent', $options) && $options['has_parent']) {
return $rendered;
}
$event->setResult($rendered);
$event->setName(ViewEvent::EVENT_RESPONSE);
$events->triggerEvent($event);
}
/usr
/local
/vufind
/vendor
/zendframework
/zend-mvc
/src
/View
/Http
/DefaultRenderingStrategy.php
if ($result instanceof Response) {
return $result;
}
// Martial arguments
$request = $e->getRequest();
$response = $e->getResponse();
$viewModel = $e->getViewModel();
if (! $viewModel instanceof ViewModel) {
return;
}
$view = $this->view;
$view->setRequest($request);
$view->setResponse($response);
$caughtException = null;
try {
$view->render($viewModel);
} catch (\Throwable $ex) {
$caughtException = $ex;
} catch (\Exception $ex) { // @TODO clean up once PHP 7 requirement is enforced
$caughtException = $ex;
}
if ($caughtException !== null) {
if ($e->getName() === MvcEvent::EVENT_RENDER_ERROR) {
throw $caughtException;
}
$application = $e->getApplication();
$events = $application->getEventManager();
$e->setError(Application::ERROR_EXCEPTION);
$e->setParam('exception', $caughtException);
$e->setName(MvcEvent::EVENT_RENDER_ERROR);
$events->triggerEvent($e);
}
/usr
/local
/vufind
/vendor
/zendframework
/zend-eventmanager
/src
/EventManager.php
}
if ($this->sharedManager) {
foreach ($this->sharedManager->getListeners($this->identifiers, $name) as $priority => $listeners) {
$listOfListenersByPriority[$priority][] = $listeners;
}
}
// Sort by priority in reverse order
krsort($listOfListenersByPriority);
// Initial value of stop propagation flag should be false
$event->stopPropagation(false);
// Execute listeners
$responses = new ResponseCollection();
foreach ($listOfListenersByPriority as $listOfListeners) {
foreach ($listOfListeners as $listeners) {
foreach ($listeners as $listener) {
$response = $listener($event);
$responses->push($response);
// If the event was asked to stop propagating, do so
if ($event->propagationIsStopped()) {
$responses->setStopped(true);
return $responses;
}
// If the result causes our validation callback to return true,
// stop propagation
if ($callback && $callback($response)) {
$responses->setStopped(true);
return $responses;
}
}
}
}
return $responses;
}
/usr
/local
/vufind
/vendor
/zendframework
/zend-eventmanager
/src
/EventManager.php
$event = clone $this->eventPrototype;
$event->setName($eventName);
if ($target !== null) {
$event->setTarget($target);
}
if ($argv) {
$event->setParams($argv);
}
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function triggerEvent(EventInterface $event)
{
return $this->triggerListeners($event);
}
/**
* @inheritDoc
*/
public function triggerEventUntil(callable $callback, EventInterface $event)
{
return $this->triggerListeners($event, $callback);
}
/**
* @inheritDoc
*/
public function attach($eventName, callable $listener, $priority = 1)
{
if (! is_string($eventName)) {
throw new Exception\InvalidArgumentException(sprintf(
'%s expects a string for the event; received %s',
__METHOD__,
(is_object($eventName) ? get_class($eventName) : gettype($eventName))
/usr
/local
/vufind
/vendor
/zendframework
/zend-mvc
/src
/Application.php
return $this->completeRequest($event);
}
/**
* Complete the request
*
* Triggers "render" and "finish" events, and returns response from
* event object.
*
* @param MvcEvent $event
* @return Application
*/
protected function completeRequest(MvcEvent $event)
{
$events = $this->events;
$event->setTarget($this);
$event->setName(MvcEvent::EVENT_RENDER);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$event->setName(MvcEvent::EVENT_FINISH);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
return $this;
}
}
/usr
/local
/vufind
/vendor
/zendframework
/zend-mvc
/src
/Application.php
// Trigger dispatch event
$event->setName(MvcEvent::EVENT_DISPATCH);
$event->stopPropagation(false); // Clear before triggering
$result = $events->triggerEventUntil($shortCircuit, $event);
// Complete response
$response = $result->last();
if ($response instanceof ResponseInterface) {
$event->setName(MvcEvent::EVENT_FINISH);
$event->setTarget($this);
$event->setResponse($response);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
$this->response = $response;
return $this;
}
$response = $this->response;
$event->setResponse($response);
return $this->completeRequest($event);
}
/**
* Complete the request
*
* Triggers "render" and "finish" events, and returns response from
* event object.
*
* @param MvcEvent $event
* @return Application
*/
protected function completeRequest(MvcEvent $event)
{
$events = $this->events;
$event->setTarget($this);
$event->setName(MvcEvent::EVENT_RENDER);
$event->stopPropagation(false); // Clear before triggering
$events->triggerEvent($event);
/usr
/local
/vufind
/public
/index.php
chdir(APPLICATION_PATH);
// Ensure vendor/ is on include_path; some PEAR components may not load correctly
// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling
// from the shared PEAR directory instead of the local copy):
$pathParts = [];
$pathParts[] = APPLICATION_PATH . '/vendor';
$pathParts[] = get_include_path();
set_include_path(implode(PATH_SEPARATOR, $pathParts));
// Composer autoloading
if (file_exists('vendor/autoload.php')) {
$loader = include 'vendor/autoload.php';
}
if (!class_exists('Zend\Loader\AutoloaderFactory')) {
throw new RuntimeException('Unable to load Zend Framework autoloader.');
}
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
//echo "a";die;
// Handle final profiling details, if necessary:
if ($xhprof) {
$xhprofData = extension_loaded('xhprof') ? xhprof_disable() : tideways_disable();
$xhprofRunId = uniqid();
$suffix = 'vufind';
$dir = ini_get('xhprof.output_dir');
if (empty($dir)) {
$dir = sys_get_temp_dir();
}
file_put_contents("$dir/$xhprofRunId.$suffix.xhprof", serialize($xhprofData));
$url = "$xhprof?run=$xhprofRunId&source=$suffix";
echo "<a href='$url'>Profiler output</a>";
}