Browse Source

Add a checkbox to disable the Registration feature in the admin panel

Remove the old flag icon system
Fix #901
Update CHANGELOG
pull/982/head
Timothée Jaussoin 5 years ago
parent
commit
5564de6c4f
  1. 6
      CHANGELOG.md
  2. 2
      VERSION
  3. 2
      app/Configuration.php
  4. 4
      app/controllers/AccountController.php
  5. 4
      app/controllers/AccountnextController.php
  6. 1
      app/widgets/AdminMain/AdminMain.php
  7. 18
      app/widgets/AdminMain/adminmain.tpl
  8. 4
      app/widgets/AdminMain/locales.ini
  9. 8
      app/widgets/Login/login.tpl
  10. 5
      app/widgets/Subscribe/Subscribe.php
  11. 16
      app/widgets/Subscribe/subscribe.tpl
  12. 21
      database/migrations/20210302212105_add_disable_registraton_to_configuration_table.php
  13. BIN
      public/theme/img/flags/ad.png
  14. BIN
      public/theme/img/flags/ae.png
  15. BIN
      public/theme/img/flags/af.png
  16. BIN
      public/theme/img/flags/ag.png
  17. BIN
      public/theme/img/flags/ai.png
  18. BIN
      public/theme/img/flags/al.png
  19. BIN
      public/theme/img/flags/am.png
  20. BIN
      public/theme/img/flags/an.png
  21. BIN
      public/theme/img/flags/ao.png
  22. BIN
      public/theme/img/flags/ar.png
  23. BIN
      public/theme/img/flags/as.png
  24. BIN
      public/theme/img/flags/at.png
  25. BIN
      public/theme/img/flags/au.png
  26. BIN
      public/theme/img/flags/aw.png
  27. BIN
      public/theme/img/flags/ax.png
  28. BIN
      public/theme/img/flags/az.png
  29. BIN
      public/theme/img/flags/ba.png
  30. BIN
      public/theme/img/flags/bb.png
  31. BIN
      public/theme/img/flags/bd.png
  32. BIN
      public/theme/img/flags/be.png
  33. BIN
      public/theme/img/flags/bf.png
  34. BIN
      public/theme/img/flags/bg.png
  35. BIN
      public/theme/img/flags/bh.png
  36. BIN
      public/theme/img/flags/bi.png
  37. BIN
      public/theme/img/flags/bj.png
  38. BIN
      public/theme/img/flags/bm.png
  39. BIN
      public/theme/img/flags/bn.png
  40. BIN
      public/theme/img/flags/bo.png
  41. BIN
      public/theme/img/flags/br.png
  42. BIN
      public/theme/img/flags/bs.png
  43. BIN
      public/theme/img/flags/bt.png
  44. BIN
      public/theme/img/flags/bv.png
  45. BIN
      public/theme/img/flags/bw.png
  46. BIN
      public/theme/img/flags/by.png
  47. BIN
      public/theme/img/flags/bz.png
  48. BIN
      public/theme/img/flags/ca.png
  49. BIN
      public/theme/img/flags/catalonia.png
  50. BIN
      public/theme/img/flags/cc.png
  51. BIN
      public/theme/img/flags/cd.png
  52. BIN
      public/theme/img/flags/cf.png
  53. BIN
      public/theme/img/flags/cg.png
  54. BIN
      public/theme/img/flags/ch.png
  55. BIN
      public/theme/img/flags/ci.png
  56. BIN
      public/theme/img/flags/ck.png
  57. BIN
      public/theme/img/flags/cl.png
  58. BIN
      public/theme/img/flags/cm.png
  59. BIN
      public/theme/img/flags/cn.png
  60. BIN
      public/theme/img/flags/co.png
  61. BIN
      public/theme/img/flags/cr.png
  62. BIN
      public/theme/img/flags/cs.png
  63. BIN
      public/theme/img/flags/cu.png
  64. BIN
      public/theme/img/flags/cv.png
  65. BIN
      public/theme/img/flags/cx.png
  66. BIN
      public/theme/img/flags/cy.png
  67. BIN
      public/theme/img/flags/cz.png
  68. BIN
      public/theme/img/flags/de.png
  69. BIN
      public/theme/img/flags/dj.png
  70. BIN
      public/theme/img/flags/dk.png
  71. BIN
      public/theme/img/flags/dm.png
  72. BIN
      public/theme/img/flags/do.png
  73. BIN
      public/theme/img/flags/dz.png
  74. BIN
      public/theme/img/flags/ec.png
  75. BIN
      public/theme/img/flags/ee.png
  76. BIN
      public/theme/img/flags/eg.png
  77. BIN
      public/theme/img/flags/eh.png
  78. BIN
      public/theme/img/flags/england.png
  79. BIN
      public/theme/img/flags/er.png
  80. BIN
      public/theme/img/flags/es.png
  81. BIN
      public/theme/img/flags/et.png
  82. BIN
      public/theme/img/flags/europeanunion.png
  83. BIN
      public/theme/img/flags/fam.png
  84. BIN
      public/theme/img/flags/fi.png
  85. BIN
      public/theme/img/flags/fj.png
  86. BIN
      public/theme/img/flags/fk.png
  87. BIN
      public/theme/img/flags/fm.png
  88. BIN
      public/theme/img/flags/fo.png
  89. BIN
      public/theme/img/flags/fr.png
  90. BIN
      public/theme/img/flags/ga.png
  91. BIN
      public/theme/img/flags/gb.png
  92. BIN
      public/theme/img/flags/gd.png
  93. BIN
      public/theme/img/flags/ge.png
  94. BIN
      public/theme/img/flags/gf.png
  95. BIN
      public/theme/img/flags/gh.png
  96. BIN
      public/theme/img/flags/gi.png
  97. BIN
      public/theme/img/flags/gl.png
  98. BIN
      public/theme/img/flags/gm.png
  99. BIN
      public/theme/img/flags/gn.png
  100. BIN
      public/theme/img/flags/gp.png

6
CHANGELOG.md

@ -1,8 +1,12 @@
Movim Changelog
================
v0.20 (trunk)
v0.19.1 (trunk)
---------------------------
* Add a checkbox to disable the Registration feature in the admin panel (#901)
* New CSS for articles table
* Fix Notifications crash on MySQL
* Fix MUC private message self Carbon handling
v0.19
---------------------------

2
VERSION

@ -1 +1 @@
v0.19
v0.19.1rc1

2
app/Configuration.php

@ -12,6 +12,7 @@ class Configuration extends Model
public $fillable = [
'description',
'disableregistration',
'firebaseauthorizationkey',
'info',
'unregister',
@ -30,6 +31,7 @@ class Configuration extends Model
protected $attributes = [
'id' => 1,
'unregister' => false,
'disableregistration' => false,
'restrictsuggestions' => false,
'loglevel' => 0,
'locale' => 'en',

4
app/controllers/AccountController.php

@ -6,6 +6,10 @@ class AccountController extends Base
{
public function dispatch()
{
if (\App\Configuration::get()->disableregistration) {
$this->redirect('login');
}
requestAPI('disconnect', 2, ['sid' => SESSION_ID]);
$this->page->setTitle(__('page.account_creation'));

4
app/controllers/AccountnextController.php

@ -6,6 +6,10 @@ class AccountnextController extends Base
{
public function dispatch()
{
if (\App\Configuration::get()->disableregistration) {
$this->redirect('login');
}
$this->page->setTitle(__('page.account_creation'));
}
}

1
app/widgets/AdminMain/AdminMain.php

@ -18,6 +18,7 @@ class AdminMain extends \Movim\Widget\Base
$configuration->password = password_hash($form['password'], PASSWORD_DEFAULT);
}
$form['disableregistration'] = (isset($form['disableregistration']));
$form['restrictsuggestions'] = (isset($form['restrictsuggestions']));
$form['chatonly'] = (isset($form['chatonly']));

18
app/widgets/AdminMain/adminmain.tpl

@ -83,6 +83,24 @@
<p class="all">{$c->__('chatonly.text')}</p>
</div>
</li>
<li class="wide">
<span class="control">
<div class="checkbox">
<input
{if="$conf->disableregistration"}
checked
{/if}
type="checkbox"
id="disableregistration"
name="disableregistration"/>
<label for="disableregistration"></label>
</div>
</span>
<div>
<p>{$c->__('disableregistration.title')}</p>
<p class="all">{$c->__('disableregistration.text')}</p>
</div>
</li>
</ul>
</div>

4
app/widgets/AdminMain/locales.ini

@ -20,6 +20,10 @@ username = Username
password = Password
re_password = Retype password
[disableregistration]
title = Disable the XMPP registration feature
text = Remove the XMPP registration flow and buttons from the interface
[whitelist]
title = Whitelisted XMPP Servers
info1 = If you want to specify a list of authorized XMPP servers on your Movim pod and forbid the connection on all the others please put their domain name here, with comma (ex: movim.eu,jabber.fr)

8
app/widgets/Login/login.tpl

@ -89,9 +89,11 @@
data-loading="{$c->__('button.connecting')}…"
value="{$c->__('page.login')}"
class="button color"/>
<a class="button flat" href="{$c->route('account')}">
{$c->__('button.sign_up')}
</a>
{if="!App\Configuration::get()->disableregistration"}
<a class="button flat" href="{$c->route('account')}">
{$c->__('button.sign_up')}
</a>
{/if}
</p>
</div>
</li>

5
app/widgets/Subscribe/Subscribe.php

@ -5,11 +5,6 @@ use Movim\Widget\Base;
class Subscribe extends Base
{
public function flagPath($country)
{
return BASE_URI.'theme/img/flags/'.strtolower($country).'.png';
}
public function accountNext($server)
{
return $this->route('accountnext', [$server]);

16
app/widgets/Subscribe/subscribe.tpl

@ -18,15 +18,6 @@
</span>
<div>
<p>
{if="!empty($config->xmppcountry)"}
<span class="info">
<img
class="flag"
title="{$config->xmppcountry}"
alt="{$config->xmppc}"
src="{$c->flagPath($config->xmppcountry)}"/>
</span>
{/if}
{$config->xmppdomain}
</p>
{if="!empty($config->xmppdescription)"}
@ -50,13 +41,6 @@
</span>
<div>
<p>
<span class="info">
<img
class="flag"
title="{$value->geo_country}"
alt="{$value->geo_country}"
src="{$c->flagPath($value->geo_country)}"/>
</span>
{$value->domain}
</p>
<p>

21
database/migrations/20210302212105_add_disable_registraton_to_configuration_table.php

@ -0,0 +1,21 @@
<?php
use Movim\Migration;
use Illuminate\Database\Schema\Blueprint;
class AddDisableRegistratonToConfigurationTable extends Migration
{
public function up()
{
$this->schema->table('configuration', function (Blueprint $table) {
$table->boolean('disableregistration')->default(false);
});
}
public function down()
{
$this->schema->table('configuration', function (Blueprint $table) {
$table->dropColumn('disableregistration');
});
}
}

BIN
public/theme/img/flags/ad.png

Before

Width: 16  |  Height: 11  |  Size: 643 B

BIN
public/theme/img/flags/ae.png

Before

Width: 16  |  Height: 11  |  Size: 408 B

BIN
public/theme/img/flags/af.png

Before

Width: 16  |  Height: 11  |  Size: 604 B

BIN
public/theme/img/flags/ag.png

Before

Width: 16  |  Height: 11  |  Size: 591 B

BIN
public/theme/img/flags/ai.png

Before

Width: 16  |  Height: 11  |  Size: 643 B

BIN
public/theme/img/flags/al.png

Before

Width: 16  |  Height: 11  |  Size: 600 B

BIN
public/theme/img/flags/am.png

Before

Width: 16  |  Height: 11  |  Size: 497 B

BIN
public/theme/img/flags/an.png

Before

Width: 16  |  Height: 11  |  Size: 488 B

BIN
public/theme/img/flags/ao.png

Before

Width: 16  |  Height: 11  |  Size: 428 B

BIN
public/theme/img/flags/ar.png

Before

Width: 16  |  Height: 11  |  Size: 506 B

BIN
public/theme/img/flags/as.png

Before

Width: 16  |  Height: 11  |  Size: 647 B

BIN
public/theme/img/flags/at.png

Before

Width: 16  |  Height: 11  |  Size: 403 B

BIN
public/theme/img/flags/au.png

Before

Width: 16  |  Height: 11  |  Size: 673 B

BIN
public/theme/img/flags/aw.png

Before

Width: 16  |  Height: 11  |  Size: 524 B

BIN
public/theme/img/flags/ax.png

Before

Width: 16  |  Height: 11  |  Size: 663 B

BIN
public/theme/img/flags/az.png

Before

Width: 16  |  Height: 11  |  Size: 589 B

BIN
public/theme/img/flags/ba.png

Before

Width: 16  |  Height: 11  |  Size: 593 B

BIN
public/theme/img/flags/bb.png

Before

Width: 16  |  Height: 11  |  Size: 585 B

BIN
public/theme/img/flags/bd.png

Before

Width: 16  |  Height: 11  |  Size: 504 B

BIN
public/theme/img/flags/be.png

Before

Width: 16  |  Height: 11  |  Size: 449 B

BIN
public/theme/img/flags/bf.png

Before

Width: 16  |  Height: 11  |  Size: 497 B

BIN
public/theme/img/flags/bg.png

Before

Width: 16  |  Height: 11  |  Size: 462 B

BIN
public/theme/img/flags/bh.png

Before

Width: 16  |  Height: 11  |  Size: 457 B

BIN
public/theme/img/flags/bi.png

Before

Width: 16  |  Height: 11  |  Size: 675 B

BIN
public/theme/img/flags/bj.png

Before

Width: 16  |  Height: 11  |  Size: 486 B

BIN
public/theme/img/flags/bm.png

Before

Width: 16  |  Height: 11  |  Size: 611 B

BIN
public/theme/img/flags/bn.png

Before

Width: 16  |  Height: 11  |  Size: 639 B

BIN
public/theme/img/flags/bo.png

Before

Width: 16  |  Height: 11  |  Size: 500 B

BIN
public/theme/img/flags/br.png

Before

Width: 16  |  Height: 11  |  Size: 593 B

BIN
public/theme/img/flags/bs.png

Before

Width: 16  |  Height: 11  |  Size: 526 B

BIN
public/theme/img/flags/bt.png

Before

Width: 16  |  Height: 11  |  Size: 631 B

BIN
public/theme/img/flags/bv.png

Before

Width: 16  |  Height: 11  |  Size: 512 B

BIN
public/theme/img/flags/bw.png

Before

Width: 16  |  Height: 11  |  Size: 443 B

BIN
public/theme/img/flags/by.png

Before

Width: 16  |  Height: 11  |  Size: 514 B

BIN
public/theme/img/flags/bz.png

Before

Width: 16  |  Height: 11  |  Size: 600 B

BIN
public/theme/img/flags/ca.png

Before

Width: 16  |  Height: 11  |  Size: 628 B

BIN
public/theme/img/flags/catalonia.png

Before

Width: 16  |  Height: 11  |  Size: 398 B

BIN
public/theme/img/flags/cc.png

Before

Width: 16  |  Height: 11  |  Size: 625 B

BIN
public/theme/img/flags/cd.png

Before

Width: 16  |  Height: 11  |  Size: 528 B

BIN
public/theme/img/flags/cf.png

Before

Width: 16  |  Height: 11  |  Size: 614 B

BIN
public/theme/img/flags/cg.png

Before

Width: 16  |  Height: 11  |  Size: 521 B

BIN
public/theme/img/flags/ch.png

Before

Width: 11  |  Height: 11  |  Size: 367 B

BIN
public/theme/img/flags/ci.png

Before

Width: 16  |  Height: 11  |  Size: 453 B

BIN
public/theme/img/flags/ck.png

Before

Width: 16  |  Height: 11  |  Size: 586 B

BIN
public/theme/img/flags/cl.png

Before

Width: 16  |  Height: 11  |  Size: 450 B

BIN
public/theme/img/flags/cm.png

Before

Width: 16  |  Height: 11  |  Size: 525 B

BIN
public/theme/img/flags/cn.png

Before

Width: 16  |  Height: 11  |  Size: 472 B

BIN
public/theme/img/flags/co.png

Before

Width: 16  |  Height: 11  |  Size: 483 B

BIN
public/theme/img/flags/cr.png

Before

Width: 16  |  Height: 11  |  Size: 477 B

BIN
public/theme/img/flags/cs.png

Before

Width: 16  |  Height: 11  |  Size: 439 B

BIN
public/theme/img/flags/cu.png

Before

Width: 16  |  Height: 11  |  Size: 563 B

BIN
public/theme/img/flags/cv.png

Before

Width: 16  |  Height: 11  |  Size: 529 B

BIN
public/theme/img/flags/cx.png

Before

Width: 16  |  Height: 11  |  Size: 608 B

BIN
public/theme/img/flags/cy.png

Before

Width: 16  |  Height: 11  |  Size: 428 B

BIN
public/theme/img/flags/cz.png

Before

Width: 16  |  Height: 11  |  Size: 476 B

BIN
public/theme/img/flags/de.png

Before

Width: 16  |  Height: 11  |  Size: 545 B

BIN
public/theme/img/flags/dj.png

Before

Width: 16  |  Height: 11  |  Size: 572 B

BIN
public/theme/img/flags/dk.png

Before

Width: 16  |  Height: 11  |  Size: 495 B

BIN
public/theme/img/flags/dm.png

Before

Width: 16  |  Height: 11  |  Size: 620 B

BIN
public/theme/img/flags/do.png

Before

Width: 16  |  Height: 11  |  Size: 508 B

BIN
public/theme/img/flags/dz.png

Before

Width: 16  |  Height: 11  |  Size: 582 B

BIN
public/theme/img/flags/ec.png

Before

Width: 16  |  Height: 11  |  Size: 500 B

BIN
public/theme/img/flags/ee.png

Before

Width: 16  |  Height: 11  |  Size: 429 B

BIN
public/theme/img/flags/eg.png

Before

Width: 16  |  Height: 11  |  Size: 465 B

BIN
public/theme/img/flags/eh.png

Before

Width: 16  |  Height: 11  |  Size: 508 B

BIN
public/theme/img/flags/england.png

Before

Width: 16  |  Height: 11  |  Size: 496 B

BIN
public/theme/img/flags/er.png

Before

Width: 16  |  Height: 11  |  Size: 653 B

BIN
public/theme/img/flags/es.png

Before

Width: 16  |  Height: 11  |  Size: 469 B

BIN
public/theme/img/flags/et.png

Before

Width: 16  |  Height: 11  |  Size: 592 B

BIN
public/theme/img/flags/europeanunion.png

Before

Width: 16  |  Height: 11  |  Size: 479 B

BIN
public/theme/img/flags/fam.png

Before

Width: 16  |  Height: 11  |  Size: 532 B

BIN
public/theme/img/flags/fi.png

Before

Width: 16  |  Height: 11  |  Size: 489 B

BIN
public/theme/img/flags/fj.png

Before

Width: 16  |  Height: 11  |  Size: 610 B

BIN
public/theme/img/flags/fk.png

Before

Width: 16  |  Height: 11  |  Size: 648 B

BIN
public/theme/img/flags/fm.png

Before

Width: 16  |  Height: 11  |  Size: 552 B

BIN
public/theme/img/flags/fo.png

Before

Width: 16  |  Height: 11  |  Size: 474 B

BIN
public/theme/img/flags/fr.png

Before

Width: 16  |  Height: 11  |  Size: 545 B

BIN
public/theme/img/flags/ga.png

Before

Width: 16  |  Height: 11  |  Size: 489 B

BIN
public/theme/img/flags/gb.png

Before

Width: 16  |  Height: 11  |  Size: 599 B

BIN
public/theme/img/flags/gd.png

Before

Width: 16  |  Height: 11  |  Size: 637 B

BIN
public/theme/img/flags/ge.png

Before

Width: 16  |  Height: 11  |  Size: 594 B

BIN
public/theme/img/flags/gf.png

Before

Width: 16  |  Height: 11  |  Size: 545 B

BIN
public/theme/img/flags/gh.png

Before

Width: 16  |  Height: 11  |  Size: 490 B

BIN
public/theme/img/flags/gi.png

Before

Width: 16  |  Height: 11  |  Size: 463 B

BIN
public/theme/img/flags/gl.png

Before

Width: 16  |  Height: 11  |  Size: 470 B

BIN
public/theme/img/flags/gm.png

Before

Width: 16  |  Height: 11  |  Size: 493 B

BIN
public/theme/img/flags/gn.png

Before

Width: 16  |  Height: 11  |  Size: 480 B

BIN
public/theme/img/flags/gp.png

Before

Width: 16  |  Height: 11  |  Size: 488 B

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save