Skip to content

Conversation

aksinha-nerdapplabs
Copy link
Contributor

PR for Issue# 5

Copy link
Contributor

@praveen-garg praveen-garg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments;

$this->addFlash('success', $flashMsg);

} catch(UploadException $e) {
$this->logMessage(400, 'danger', $e->getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not we use logMessageAndFlash?

// Always catch exact exception for which flash message or logger is needed,
// otherwise catch block will not get executed on higher or lower ranked exceptions.
} catch(UploadException $e) {
$this->logMessage(400, 'danger', $e->getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logMessageAndFlash?

* {"name"="dob", "dataType"="datetime", "required"=true, "description"="date of birth mm/dd/yyyy"},
* {"name"="email", "dataType"="email", "required"=true, "description"="Email"},
* {"name"="email_confirmation", "dataType"="integer", "required"=true, "description"="0-email confirmation not required, 1-required"},
* {"name"="image", "dataType"="image/jpeg, image/jpg, image/gif, image/png", "required"=false, "description"="Profile Picture within 1024k size"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did we limit 1024K


/**
* @var string $image
* @Assert\File(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, here it is! cool!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, User (who is signing up) should be able add/ remove or update user profile image; not the admin only.

->add('dob', DateType::class, array('widget' => 'single_text', 'format' => 'M/d/y'))
->add('username', TextType::class)
->add('password', PasswordType::class, array('data' => ''))
->add('password', TextType::class)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it back to TextType?
it was chnaged to PasswordType in last PR
https://github.com/nerdapplabs/authOauth/pull/9/files#diff-3683af68b1a14d46bf30b457a8ec4ddfR31

@aksinha-nerdapplabs
Copy link
Contributor Author

@praveen-garg have a look. Changes are final till now.

$user->setEmail($request->request->get('email'));
$user->setFirstname($request->request->get('firstname'));
$user->setLastname($request->request->get('lastname'));
$user->setLastname($request->request->get('lastname') ? $request->request->get('lastname') : null);
Copy link
Contributor

@praveen-garg praveen-garg Feb 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should not we make it EMPTY string ? ""

$user->setLastname($request->request->get('lastname') ? $request->request->get('lastname') : "");

$oAuthRtn = 'Pending';
$msg = 'N.A.';
$grantType = 'password';
$loginConfirmation = $this->container->getParameter('login_confirmation');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the use of this var?

$loginConfirmation = $this->container->getParameter('login_confirmation');

if ('1' == $request->request->get('email_confirmation')) {
if (true == $this->container->getParameter('email_confirmation') ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email_confirmation > registration_requires_email_confirmation


// If no image file, then return empty response
if (!$user->getImage()) {
return new Response();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please explain more?

If no image file, then return empty response ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, Empty with 200 ok.

* description="Fetch User profile detail. Access token to be provided in header (Authorization = Bearer <access token>)",
* parameters={
* {"name"="image", "dataType"="image/jpeg, image/jpg, image/gif, image/png", "required"=false, "description"="Profile Picture within 1024k size"},
* {"name"="image", "dataType"="image/jpeg, image/jpg, image/gif, image/png", "required"=false, "description"="jpeg/jpg/png/gif Pic Size: 1024k, Width: 50-300px, Height: 50-300px"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

older looks better!

images_profile_directory: '%kernel.root_dir%/../web%images_profile_suffix%'
images_profile_directory: '%kernel.root_dir%/../web/images/profile'
email_confirmation: false
login_confirmation: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see previous comments

@praveen-garg
Copy link
Contributor

@aksinha-nerdapplabs we must keep PR specific to the issue; not sure why this PR has registration_requires_email_confirmation related change. a new PR (with minimum & to the point chnages) could have been easy to review/ test and merge

if ('1' == $request->request->get('email_confirmation')) {
// If Login confirmation is set, then upon successful registration, user will be logged in automatically,
// else user will be redirected to a login page to log in with the new credentials.
$loginConfirmation = $this->container->getParameter('login_confirmation');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

login_confirmation > login_required_after_signup

$user,
$response);
} catch (AccountStatusException $ex) {
// We simply do not authenticate users which do not pass the user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we should log?

'entry_options' => array(
'label' => false,
'choices' => array(
'ROLE_ADMIN' => 'ROLE_ADMIN',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? yes?

'entry_options' => array(
'label' => false,
'choices' => array(
'ROLE_ADMIN' => 'ROLE_ADMIN',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are your sure?

Copy link
Contributor

@praveen-garg praveen-garg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY review; need more testing..

@praveen-garg praveen-garg merged commit 250ad03 into nerdapplabs:master Feb 22, 2017
@aksinha-nerdapplabs aksinha-nerdapplabs deleted the profile_image_added branch February 23, 2017 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants