Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
2
200050107-200050157-git
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pranjal
200050107-200050157-git
Commits
9b94fc37
You need to sign in or sign up before continuing.
Commit
9b94fc37
authored
Aug 07, 2021
by
Virendra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: The Better Idea
parent
4d8e5555
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
31 deletions
+54
-31
passwords.h
passwords.h
+52
-29
utils.h
utils.h
+2
-2
No files found.
passwords.h
View file @
9b94fc37
#ifndef PASSWORDS_H
#ifndef PASSWORDS_H
#define PAS
W
SWORDS_H
#define PASSWORDS_H
#include<map>
#include<map>
#include<string>
#include<string>
#include<vector>
using
namespace
std
;
using
namespace
std
;
map
<
string
,
string
>
passwor
ds
{
map
<
string
,
int
>
useri
ds
{
{
"Tinsmorem"
,
"Iltil"
},
{
"Tinsmorem"
,
0
},
{
"Ulyglet"
,
"Snurgrurg"
},
{
"Ulyglet"
,
1
},
{
"Lafibnom"
,
"Diamdioc"
},
{
"Lafibnom"
,
2
},
{
"Thenbovir"
,
"Oudrarrouz"
},
{
"Thenbovir"
,
3
},
{
"Gallnip"
,
"Haulmi"
},
{
"Gallnip"
,
4
},
{
"Froolvess"
,
"Holdiz"
},
{
"Froolvess"
,
5
},
{
"Smameknuc"
,
"Hinnyual"
},
{
"Smameknuc"
,
6
},
{
"Smedekmet"
,
"Traolbubrorg"
},
{
"Smedekmet"
,
7
},
{
"Cebbnec"
,
"Khishohi"
},
{
"Cebbnec"
,
8
},
{
"Klolyddwac"
,
"Maennius"
},
{
"Klolyddwac"
,
9
},
{
"Blivylnas"
,
"Jolmuulmohr"
},
{
"Blivylnas"
,
10
},
{
"Glyhamdas"
,
"Drustiel"
},
{
"Glyhamdas"
,
11
},
{
"Hillnar"
,
"Nanruddiarth"
},
{
"Hillnar"
,
12
},
{
"Phieddlu"
,
"Zussial"
},
{
"Phieddlu"
,
13
},
{
"Fnamdyn"
,
"Laszo"
},
{
"Fnamdyn"
,
14
},
{
"Fladnivith"
,
"Nathentoih"
},
{
"Fladnivith"
,
15
},
{
"Phelnyll"
,
"Phorughoelle"
},
{
"Phelnyll"
,
16
},
{
"Snallbam"
,
"Skilzeda"
},
{
"Snallbam"
,
17
},
{
"Fensmyl"
,
"Vrakniarth"
},
{
"Fensmyl"
,
18
},
{
"Pibkecim"
,
"Jerpuldo"
}
{
"Pibkecim"
,
19
},
};
};
//Return true only if the person is present in the database
vector
<
string
>
passwords
{
bool
find_user
(
string
name
){
"Iltil"
,
if
(
passwords
.
find
(
name
)
!=
passwords
.
end
())
return
true
;
"Snurgrurg"
,
else
return
false
;
"Diamdioc"
,
"Oudrarrouz"
,
"Haulmi"
,
"Holdiz"
,
"Hinnyual"
,
"Traolbubrorg"
,
"Khishohi"
,
"Maennius"
,
"Jolmuulmohr"
,
"Drustiel"
,
"Nanruddiarth"
,
"Zussial"
,
"Laszo"
,
"Nathentoih"
,
"Phorughoelle"
,
"Skilzeda"
,
"Vrakniarth"
,
"Jerpuldo"
};
int
find_userid
(
string
name
){
if
(
userids
.
find
(
name
)
!=
userids
.
end
())
return
userids
[
name
];
else
return
-
1
;
}
}
//Returns the password for a particular person
string
get_password
(
string
name
){
string
get_password
(
string
name
){
return
passwords
[
name
];
int
user_id
=
-
1
;
if
((
user_id
=
find_userid
(
name
))
<
0
)
return
""
;
else
return
passwords
[
user_id
];
}
}
#endif
#endif
utils.h
View file @
9b94fc37
#include "passwords.h"
#include "passwords.h"
bool
login
(
string
name
,
string
password
)
bool
login
(
string
name
,
string
password
)
{
{
if
(
find_user
(
name
)
)
if
(
find_user
id
(
name
)
>=
0
)
{
{
string
s
=
get_password
(
name
);
string
s
=
get_password
(
name
);
if
(
s
==
password
)
if
(
s
==
password
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment