release beta4
This commit is contained in:
@@ -99,6 +99,52 @@ header section .form-input:hover {
|
||||
box-shadow: 0 7px 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
header section .failure {
|
||||
background: #f00;
|
||||
position: relative;
|
||||
border: 3px solid #fff;
|
||||
font: bold 16px 'Rajdhani', sans-serif;
|
||||
color: #FFFFFF;
|
||||
padding: 10px;
|
||||
margin: 30px 0 10px 0;
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
header section .failure:after,
|
||||
header section .failure:before {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
left: 50px;
|
||||
height: 0;
|
||||
width: 0;
|
||||
border: solid transparent;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
header section .failure:after {
|
||||
border-color: rgba(0, 0, 0, 0);
|
||||
border-bottom-color: #f00;
|
||||
border-width: 20px;
|
||||
margin-left: -20px;
|
||||
}
|
||||
|
||||
header section .failure:before {
|
||||
border-color: rgba(255, 255, 255, 0);
|
||||
border-bottom-color: #ffffff;
|
||||
border-width: 26px;
|
||||
margin-left: -26px;
|
||||
}
|
||||
|
||||
header section .failure ul {
|
||||
display: inline-block;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
|
||||
header section h3.or {
|
||||
font: bold 16px 'Rajdhani', sans-serif;
|
||||
text-transform: uppercase;
|
||||
@@ -165,6 +211,19 @@ header section div.buttons > a.slack-login:hover {
|
||||
color: #5c3a58;
|
||||
}
|
||||
|
||||
header section .failure-main {
|
||||
background: #f00;
|
||||
max-width: 500px;
|
||||
border: 3px solid #fff;
|
||||
font: bold 16px 'Rajdhani', sans-serif;
|
||||
color: #FFFFFF;
|
||||
padding: 10px;
|
||||
margin: 0 0 20px 0;
|
||||
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 1100px) {
|
||||
header section .form-input,
|
||||
header section .form-check {
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
{% block title %} - Sign up{% endblock %}
|
||||
|
||||
{% block fos_user_content %}
|
||||
<section class="header-content">
|
||||
<div class="logo">
|
||||
@@ -14,24 +16,48 @@
|
||||
<div class="db">
|
||||
<form action="{{ path('fos_user_registration_register') }}"
|
||||
method="post">
|
||||
{{ form_widget(form._token) }}
|
||||
|
||||
{% if form_errors(form) is not empty %}
|
||||
<div class="failure-main">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{{ form_widget(form.email, {'attr': {'placeholder': 'Email', 'class': 'form-input form-username'}}) }}
|
||||
{{ form_errors(form.email) }}
|
||||
{% if form_errors(form.email) is not empty %}
|
||||
<div class="failure">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.email) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ form_widget(form.username, {'attr': {'placeholder': 'Username ', 'class': 'form-input form-username'}}) }}
|
||||
{{ form_errors(form.username) }}
|
||||
{% if form_errors(form.username) is not empty %}
|
||||
<div class="failure">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.username) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ form_widget(form.plainPassword.first, {'attr': {'placeholder': 'Password', 'class': 'form-input form-username'}}) }}
|
||||
{{ form_errors(form.plainPassword.first) }}
|
||||
{% if form_errors(form.plainPassword.first) is not empty %}
|
||||
<div class="failure">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.plainPassword.first) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ form_widget(form.plainPassword.second, {'attr': {'placeholder': 'Repeat password', 'class': 'form-input'}}) }}
|
||||
{{ form_errors(form.plainPassword.second) }}
|
||||
{% if form_errors(form.plainPassword.second) is not empty %}
|
||||
<div class="failure">
|
||||
<i class="fa fa-exclamation-circle"></i> {{ form_errors(form.plainPassword.second) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="input-submit">
|
||||
@@ -56,7 +82,7 @@
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
{% javascripts
|
||||
{% javascripts filter='?uglifyjs2'
|
||||
'@JotunheimrUserBundle/Resources/public/js/register.js' %}
|
||||
<script type="text/javascript" src="{{ asset_url }}"></script>
|
||||
{% endjavascripts %}
|
||||
@@ -65,7 +91,7 @@
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
|
||||
{% stylesheets filter='cssrewrite'
|
||||
{% stylesheets filter='?uglifycss'
|
||||
'@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css'
|
||||
'@JotunheimrUserBundle/Resources/public/css/layout.css' %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
{% trans_default_domain 'FOSUserBundle' %}
|
||||
|
||||
{% block title %} - Sign in{% endblock %}
|
||||
|
||||
{% block fos_user_content %}
|
||||
{% if error %}
|
||||
{{ error.messageKey|trans(error.messageData, 'security') }}
|
||||
@@ -17,7 +19,16 @@
|
||||
<h1>Sign in</h1>
|
||||
<form action="{{ path("fos_user_security_check") }}" method="post"
|
||||
class="ac-custom ac-checkbox ac-boxfill">
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>
|
||||
|
||||
{% if csrf_token %}
|
||||
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}"/>
|
||||
{% endif %}
|
||||
|
||||
{% if error %}
|
||||
<div class="failure-main">
|
||||
<i class="fa fa-exclamation-circle"></i> <strong>Login error!</strong> {{ error.messageKey|trans({}, 'messages') }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<input type="text" id="username" name="_username" value="{{ last_username }}"
|
||||
class="form-input form-username"
|
||||
@@ -53,7 +64,7 @@
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
|
||||
{% javascripts
|
||||
{% javascripts filter='?uglifyjs2'
|
||||
'@JotunheimrUserBundle/Resources/public/js/register.js'
|
||||
'@JotunheimrUserBundle/Resources/public/js/svgcheckbox.js' %}
|
||||
<script type="text/javascript" src="{{ asset_url }}"></script>
|
||||
@@ -63,7 +74,7 @@
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
|
||||
{% stylesheets filter='cssrewrite'
|
||||
{% stylesheets filter='?uglifycss'
|
||||
'@JotunheimrUserBundle/Resources/public/css/font-awesome/css/font-awesome.min.css'
|
||||
'@JotunheimrUserBundle/Resources/public/css/svgcheckbox.css' %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
|
||||
|
||||
@@ -1,89 +1,39 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>{% block title %}{{ project_name }} Admin - Login{% endblock %}</title>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
{% block stylesheets %}
|
||||
{% stylesheets filter='cssrewrite'
|
||||
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css'
|
||||
'@MineSeekerBundle/Resources/public/css/style.homepage.css'
|
||||
'@JotunheimrUserBundle/Resources/public/css/layout.css' %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
|
||||
{% endstylesheets %}
|
||||
{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}"/>
|
||||
{% extends '::base.html.twig' %}
|
||||
|
||||
{% block stylesheets %}
|
||||
{{ parent() }}
|
||||
|
||||
{% stylesheets filter='?uglifycss'
|
||||
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/css/bootstrap.min.css'
|
||||
'@MineSeekerBundle/Resources/public/css/style.homepage.css'
|
||||
'@JotunheimrUserBundle/Resources/public/css/layout.css' %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url }}"/>
|
||||
{% endstylesheets %}
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Rajdhani:300,400,500,600,700&subset=latin-ext"
|
||||
rel="stylesheet">
|
||||
<script type="text/javascript">
|
||||
(function (i, s, o, g, r, a, m) {
|
||||
i['GoogleAnalyticsObject'] = r;
|
||||
i[r] = i[r] || function () {
|
||||
(i[r].q = i[r].q || []).push(arguments)
|
||||
}, i[r].l = 1 * new Date();
|
||||
a = s.createElement(o),
|
||||
m = s.getElementsByTagName(o)[0];
|
||||
a.async = 1;
|
||||
a.src = g;
|
||||
m.parentNode.insertBefore(a, m)
|
||||
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
|
||||
{% endblock %}
|
||||
|
||||
ga('create', 'UA-88761060-1', 'auto');
|
||||
ga('send', 'pageview');
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="fb-root"></div>
|
||||
|
||||
{% if app.request.hasPreviousSession %}
|
||||
{% for type, messages in app.session.flashbag.all() %}
|
||||
{% for message in messages %}
|
||||
<div class="flash-{{ type }}">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% block bodyTop %}
|
||||
{% if app.request.hasPreviousSession %}
|
||||
{% for type, messages in app.session.flashbag.all() %}
|
||||
{% for message in messages %}
|
||||
<div class="flash-{{ type }}">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
<header>
|
||||
{% block header %}
|
||||
{% block fos_user_content %}{% endblock fos_user_content %}
|
||||
</header>
|
||||
<main>
|
||||
{% block main %}{% endblock %}
|
||||
</main>
|
||||
<footer>
|
||||
{% block footer %}{% endblock %}
|
||||
</footer>
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script type="text/javascript">
|
||||
window.fbAsyncInit = function () {
|
||||
FB.init({
|
||||
appId: '{{ facebook_api }}',
|
||||
xfbml: true,
|
||||
cookie: true,
|
||||
status: true,
|
||||
oauth: true,
|
||||
version: '{{ facebook_api_version }}'
|
||||
});
|
||||
};
|
||||
{{ parent() }}
|
||||
|
||||
(function (d, s, id) {
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) {
|
||||
return;
|
||||
}
|
||||
js = d.createElement(s);
|
||||
js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
</script>
|
||||
|
||||
{% javascripts
|
||||
{% javascripts filter='?uglifyjs2'
|
||||
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-3.0.0.min.js'
|
||||
'@JotunheimrAdminBundle/Resources/public/js/vendor/plugins/jQuery/jquery-migrate-3.0.0.min.js'
|
||||
'@JotunheimrAdminBundle/Resources/public/js/vendor/bootstrap/js/bootstrap.min.js' %}
|
||||
@@ -98,5 +48,3 @@
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -74,8 +74,8 @@ class MyFOSUBUserProvider extends BaseFOSUBProvider
|
||||
$user->setFacebookId($response->getUsername());
|
||||
$user->setEmail($response->getEmail());
|
||||
$user->setEmailCanonical($response->getEmail());
|
||||
$user->setUsername($this->slugify($response->getRealName()));
|
||||
$user->setUsernameCanonical($this->slugify($response->getRealName()));
|
||||
$user->setUsername($this->slug($response->getRealName()));
|
||||
$user->setUsernameCanonical($this->slug($response->getRealName()));
|
||||
$user->setRealName($response->getRealName());
|
||||
$user->setNickName($response->getNickname());
|
||||
if ($empty) {
|
||||
@@ -88,25 +88,11 @@ class MyFOSUBUserProvider extends BaseFOSUBProvider
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $text
|
||||
* @return mixed|string
|
||||
* @param $string
|
||||
* @return string
|
||||
*/
|
||||
private function slugify($text)
|
||||
private function slug($string)
|
||||
{
|
||||
$text = preg_replace('#[^\\pL\d]+#u', '-', $text);
|
||||
$text = trim($text, '-');
|
||||
|
||||
if (function_exists('iconv')) {
|
||||
$text = iconv('utf-8', 'us-ascii//TRANSLIT', $text);
|
||||
}
|
||||
|
||||
$text = strtolower($text);
|
||||
$text = preg_replace('#[^-\w]+#', '', $text);
|
||||
|
||||
if (empty($text)) {
|
||||
return 'n-a';
|
||||
}
|
||||
|
||||
return $text;
|
||||
return strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user