Skip to content

Commit ed51ddc

Browse files
committed
added user additional data field + fixes
1 parent 0548c5e commit ed51ddc

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

app/base/tools/Plates/SiteBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ public function drawIcon($icon_name)
197197
* @param string $variable
198198
* @return mixed
199199
*/
200-
public function env($variable)
200+
public function env($variable, $default = null)
201201
{
202-
return $this->container->get('utils')->getEnv($variable);
202+
return $this->container->get('utils')->getEnv($variable, $default);
203203
}
204204

205205
/**

app/base/tools/Utils/HtmlPartsRenderer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,12 +617,14 @@ public function renderAdminTable($elements, $header = null, BasePage $current_pa
617617
//$style="max-width:100%;font-size: 9px;line-height: 11px;min-width: 100%;padding: 3px 1px;margin: 0;border: 1px solid #555;border-radius: 2px;";
618618
foreach ($header as $k => $v) {
619619
if (is_array($v) && isset($v['search']) && boolval($v['search']) == true) {
620+
$searchqueryparam = (is_array($current_page->getRequest()->query->get('search')) && isset($current_page->getRequest()->query->get('search')[$v['search']])) ? $current_page->getRequest()->query->get('search')[$v['search']] : '';
621+
620622
$td = $this->getContainer()->make(
621623
TagElement::class,
622624
['options' => [
623625
'tag' => 'td',
624626
'attributes' => ['class' => 'small'],
625-
'text' => '<input class="form-control" name="search['.$v['search'].']" value="'.$current_page->getRequest()->query->get('search')[$v['search']].'"/>',
627+
'text' => '<input class="form-control" name="search['.$v['search'].']" value="'.$searchqueryparam.'"/>',
626628
]]
627629
);
628630
$add_searchrow = true;

app/site/migrations/CreateUsersTableMigration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function addDBTableDefinition(Table $table)
5252
->addColumn('nickname', 'VARCHAR', [255])
5353
->addColumn('locale', 'VARCHAR', [10])
5454
->addColumn('confirmation_code', 'VARCHAR', [20], [], true, null)
55+
->addColumn('additional_data', 'TEXT', null)
5556
->addColumn('created_at', 'TIMESTAMP', null, [], false, 'CURRENT_TIMESTAMP()')
5657
->addColumn('updated_at', 'TIMESTAMP', null, [], false, 'CURRENT_TIMESTAMP()')
5758
->addIndex(null, 'id', Index::TYPE_PRIMARY)

app/site/models/User.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
* @method int getRoleId()
2424
* @method string getEmail()
2525
* @method string getNickname()
26+
* @method string getLocale()
27+
* @method string getConfirmationCode()
28+
* @method string getAdditionalData()
2629
* @method \DateTime getCreatedAt()
2730
* @method \DateTime getUpdatedAt()
2831
*/
@@ -93,7 +96,6 @@ public function getRegisteredSince()
9396
return "";
9497
}
9598

96-
9799
/**
98100
* calculates JWT token id
99101
*
@@ -115,7 +117,7 @@ public function getJWT()
115117
{
116118
$this->checkLoaded();
117119

118-
return $this->getContainer()->get('jwt:builder')
120+
$token = $this->getContainer()->get('jwt:builder')
119121
->setIssuer($this->getContainer()->get('jwt_issuer'))
120122
->setAudience($this->getContainer()->get('jwt_audience'))
121123
->setId($this->calcTokenId(), true)
@@ -142,5 +144,7 @@ function ($el) {
142144
)
143145
])
144146
->getToken(); // Retrieves the generated token
147+
148+
return $token;
145149
}
146150
}

0 commit comments

Comments
 (0)