taskrambler  0.1.8
Web server and task management solution.
_get_credential_from_args.c File Reference
#include "hash.h"
#include "auth/credential.h"
#include "utils/memory.h"
#include "commons.h"
+ Include dependency graph for _get_credential_from_args.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

int _controllerValidatePasswordRepeat (char *, size_t, char *, size_t)
 
Credential _controllerGetCredentialFromArgs (Hash args)
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file _get_credential_from_args.c.

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 23 of file _get_credential_from_args.c.

Function Documentation

Credential _controllerGetCredentialFromArgs ( Hash  args)

Definition at line 34 of file _get_credential_from_args.c.

References _controllerValidatePasswordRepeat(), CRED_PASSWORD, CSTRA, FALSE, and hashGet().

Referenced by _controllerProcessUserCreateArgs().

35 {
36  HashValue email = hashGet(args, CSTRA("email"));
37  HashValue password = hashGet(args, CSTRA("password"));
38  HashValue pwrepeat = hashGet(args, CSTRA("pwrepeat"));
39 
40  if (
41  NULL == email ||
42  NULL == password ||
43  NULL == pwrepeat)
44  {
45  return FALSE;
46  }
47 
49  password->value,
50  password->nvalue,
51  pwrepeat->value,
52  pwrepeat->nvalue))
53  {
54  return FALSE;
55  }
56 
57  return new(Credential,
59  (char *)(email->value), email->nvalue,
60  (char *)(password->value), password->nvalue);
61 }
#define CSTRA(val)
Const STRing Argument.
Definition: memory.h:26
#define FALSE
Definition: commons.h:28
void * hashGet(Hash, const char *, size_t)
Definition: hash/get.c:51
int _controllerValidatePasswordRepeat(char *, size_t, char *, size_t)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int _controllerValidatePasswordRepeat ( char *  ,
size_t  ,
char *  ,
size_t   
)

Definition at line 30 of file _validate_password_repeat.c.

References FALSE, and TRUE.

Referenced by _controllerGetCredentialFromArgs().

35 {
36  if (
37  npassword != npwrepeat ||
38  0 != memcmp(password, pwrepeat, npassword))
39  {
40  return FALSE;
41  }
42 
43  return TRUE;
44 }
#define FALSE
Definition: commons.h:28
#define TRUE
Definition: commons.h:27

+ Here is the caller graph for this function: