Skip to content
Snippets Groups Projects
Commit 4ccdc219 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

Locked discipline fix, updates fix

parent 9bc012e7
No related merge requests found
...@@ -13,16 +13,10 @@ class Controller_Authentication extends Controller { ...@@ -13,16 +13,10 @@ class Controller_Authentication extends Controller {
} }
} }
} }
public function action_sign()
{
if(!User::instance()->isSignedIn())
{
$type = $this->request->param('type');
if(empty($type)) $type = 'in';
$twig = Twig::factory('sign/'.$type);
$fp = fopen(APPPATH.'updates.txt', 'r');
protected function getUpdates() {
$fp = fopen(APPPATH.'updates.txt', 'r');
$updates['Date'] = fgets($fp, 999); $updates['Date'] = fgets($fp, 999);
$updates['Text'] = '<ol>'; $updates['Text'] = '<ol>';
if ($fp) if ($fp)
...@@ -32,9 +26,19 @@ class Controller_Authentication extends Controller { ...@@ -32,9 +26,19 @@ class Controller_Authentication extends Controller {
$updates['Text'] = $updates['Text'].'<li>'.fgets($fp, 999).'</li>'; $updates['Text'] = $updates['Text'].'<li>'.fgets($fp, 999).'</li>';
} }
} }
$updates['Text'] = $updates['Text'].'</ol>'; $updates['Text'] = $updates['Text'].'</ol>';
$twig->Updates = $updates; return $updates;
}
public function action_sign()
{
if(!User::instance()->isSignedIn())
{
$type = $this->request->param('type');
if(empty($type)) $type = 'in';
$twig = Twig::factory('sign/'.$type);
$twig->Updates = self::getUpdates();
$this->response->body($twig); $this->response->body($twig);
} }
} }
...@@ -43,18 +47,8 @@ class Controller_Authentication extends Controller { ...@@ -43,18 +47,8 @@ class Controller_Authentication extends Controller {
{ {
if(!User::instance()->isSignedIn()) if(!User::instance()->isSignedIn())
{ {
$t = '<ol>';
$fp = fopen(APPPATH.'updates.txt', 'r');
if ($fp)
{
while (!feof($fp))
{
$t = $t.'<li>'.fgets($fp, 999).'</li>';
}
}
$twig = Twig::factory('sign/remindpass'); $twig = Twig::factory('sign/remindpass');
$twig->Updates = $t.'</ol>'; $twig->Updates = $twig->Updates = self::getUpdates();
$this->response->body($twig); $this->response->body($twig);
} }
} }
...@@ -67,18 +61,8 @@ class Controller_Authentication extends Controller { ...@@ -67,18 +61,8 @@ class Controller_Authentication extends Controller {
'Сожалеем, но данная ссылка для восстановления пароля более недействительна!'); 'Сожалеем, но данная ссылка для восстановления пароля более недействительна!');
if(!User::instance()->isSignedIn()) if(!User::instance()->isSignedIn())
{ {
$t = '<ol>';
$fp = fopen(APPPATH.'updates.txt', 'r');
if ($fp)
{
while (!feof($fp))
{
$t = $t.'<li>'.fgets($fp, 999).'</li>';
}
}
$twig = Twig::factory('sign/changepass'); $twig = Twig::factory('sign/changepass');
$twig->Updates = $t.'</ol>'; $twig->Updates = self::getUpdates();
$twig->Token = $token; $twig->Token = $token;
$this->response->body($twig); $this->response->body($twig);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
Если это были Вы, то для завершения процедуры смены пароля пройдите по ссылке, указаной ниже: Если это были Вы, то для завершения процедуры смены пароля пройдите по ссылке, указаной ниже:
</p> </p>
<br> <br>
<a href="http://rating.mmcs.sfedu.ru/remind/{{ Token }}">http://rating.mmcs.sfedu.ru/remind/{{ Token }}</a> <a href="{{ curl }}/remind/{{ Token }}">http://rating.mmcs.sfedu.ru/remind/{{ Token }}</a>
<br> <br>
<p> <p>
Данная ссылка работоспособна в течение одного часа. Данная ссылка работоспособна в течение одного часа.
......
...@@ -3,10 +3,15 @@ ...@@ -3,10 +3,15 @@
{% set step_2 = 'active' %} {% set step_2 = 'active' %}
{% block discipline_media %} {% block discipline_media %}
{{ HTML.script('media/js/discipline/EditStructure.js')|raw }} {% if Discipline.isLocked != 1 %}
{{ HTML.script('media/js/discipline/EditStructure.js')|raw }}
{% else %}
{{ HTML.script('media/js/discipline/EditStructureLocked.js')|raw }}
{% endif %}
{% endblock %} {% endblock %}
{% block map_content %} {% block map_content %}
<p class="notification" style="display: none;">{{ Discipline.SemesterNum }} семестр {{ Discipline.SemesterYear }}/{{ Discipline.SemesterYear + 1 }} учебного года</p> <p class="notification" style="display: none;">{{ Discipline.SemesterNum }} семестр {{ Discipline.SemesterYear }}/{{ Discipline.SemesterYear + 1 }} учебного года</p>
<div class="rateIndicatorDIV"> <div class="rateIndicatorDIV">
Количество баллов: <span class="rateIndicator">{{ Map.MaxRate }}</span>{% if Map.isSetBonus == true %} + 10 бонусных баллов{% endif %} Количество баллов: <span class="rateIndicator">{{ Map.MaxRate }}</span>{% if Map.isSetBonus == true %} + 10 бонусных баллов{% endif %}
...@@ -25,7 +30,7 @@ ...@@ -25,7 +30,7 @@
<div class="moduleGroup" id="{{ Map[i].ModuleID }}"> <div class="moduleGroup" id="{{ Map[i].ModuleID }}">
<div class="moduleHead"> <div class="moduleHead">
<div class="name"> <div class="name">
<input type="text" class="inputName moduleName" placeholder="Наименование модуля" value="{{ Map[i].ModuleTitle }}" > <input type="text" class="inputName moduleName" placeholder="Наименование модуля" value="{{ Map[i].ModuleTitle }}">
</div> </div>
<div class="currentControl">{{ Map[i].CurrentControl }}</div> <div class="currentControl">{{ Map[i].CurrentControl }}</div>
<div class="landmarkControl">{{ Map[i].LandmarkControl }}</div> <div class="landmarkControl">{{ Map[i].LandmarkControl }}</div>
......
...@@ -134,6 +134,7 @@ class Kohana_Account { ...@@ -134,6 +134,7 @@ class Kohana_Account {
$this->_model->createRecoveryToken($email, $requestToken); $this->_model->createRecoveryToken($email, $requestToken);
$subject = ASSEMBLY_SYSTEM_NAME.": Восстановление пароля"; $subject = ASSEMBLY_SYSTEM_NAME.": Восстановление пароля";
$twig = Twig::factory('email/recovery'); $twig = Twig::factory('email/recovery');
$twig->curl = URL::base(TRUE, 'https');
$twig->Token = $requestToken; $twig->Token = $requestToken;
$twig->EMail = $email; $twig->EMail = $email;
$twig->Subject = $subject; $twig->Subject = $subject;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment