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
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
Hide 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
#define PAS
W
SWORDS_H
#define PASSWORDS_H
#include<map>
#include<string>
#include<vector>
using
namespace
std
;
map
<
string
,
string
>
passwor
ds
{
{
"Tinsmorem"
,
"Iltil"
},
{
"Ulyglet"
,
"Snurgrurg"
},
{
"Lafibnom"
,
"Diamdioc"
},
{
"Thenbovir"
,
"Oudrarrouz"
},
{
"Gallnip"
,
"Haulmi"
},
{
"Froolvess"
,
"Holdiz"
},
{
"Smameknuc"
,
"Hinnyual"
},
{
"Smedekmet"
,
"Traolbubrorg"
},
{
"Cebbnec"
,
"Khishohi"
},
{
"Klolyddwac"
,
"Maennius"
},
{
"Blivylnas"
,
"Jolmuulmohr"
},
{
"Glyhamdas"
,
"Drustiel"
},
{
"Hillnar"
,
"Nanruddiarth"
},
{
"Phieddlu"
,
"Zussial"
},
{
"Fnamdyn"
,
"Laszo"
},
{
"Fladnivith"
,
"Nathentoih"
},
{
"Phelnyll"
,
"Phorughoelle"
},
{
"Snallbam"
,
"Skilzeda"
},
{
"Fensmyl"
,
"Vrakniarth"
},
{
"Pibkecim"
,
"Jerpuldo"
}
map
<
string
,
int
>
useri
ds
{
{
"Tinsmorem"
,
0
},
{
"Ulyglet"
,
1
},
{
"Lafibnom"
,
2
},
{
"Thenbovir"
,
3
},
{
"Gallnip"
,
4
},
{
"Froolvess"
,
5
},
{
"Smameknuc"
,
6
},
{
"Smedekmet"
,
7
},
{
"Cebbnec"
,
8
},
{
"Klolyddwac"
,
9
},
{
"Blivylnas"
,
10
},
{
"Glyhamdas"
,
11
},
{
"Hillnar"
,
12
},
{
"Phieddlu"
,
13
},
{
"Fnamdyn"
,
14
},
{
"Fladnivith"
,
15
},
{
"Phelnyll"
,
16
},
{
"Snallbam"
,
17
},
{
"Fensmyl"
,
18
},
{
"Pibkecim"
,
19
},
};
//Return true only if the person is present in the database
bool
find_user
(
string
name
){
if
(
passwords
.
find
(
name
)
!=
passwords
.
end
())
return
true
;
else
return
false
;
vector
<
string
>
passwords
{
"Iltil"
,
"Snurgrurg"
,
"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
){
return
passwords
[
name
];
int
user_id
=
-
1
;
if
((
user_id
=
find_userid
(
name
))
<
0
)
return
""
;
else
return
passwords
[
user_id
];
}
#endif
utils.h
View file @
9b94fc37
#include "passwords.h"
bool
login
(
string
name
,
string
password
)
{
if
(
find_user
(
name
)
)
if
(
find_user
id
(
name
)
>=
0
)
{
string
s
=
get_password
(
name
);
if
(
s
==
password
)
...
...
@@ -14,4 +14,4 @@ bool login(string name, string password)
}
else
return
false
;
}
\ No newline at end of file
}
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