login system

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
dragancesu
Posts: 672
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

login system

Post by dragancesu » Mon Nov 10, 2014 10:12 pm

I tried to make a simple system to log on to the system, you just need to compile

User and password are stored in users.dbf and initially is admin / admin, when you sign up you'll be able to add, edit, delete,

There is encryption of passwords as an example, it is a function code_pass and write one of your, the example is simple, it adds 20 to characters of password
Attachments
login.zip
(3.72 KiB) Downloaded 239 times

User avatar
danielmaximiliano
Posts: 2118
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 145 times
Been thanked: 20 times
Contact:

Post by danielmaximiliano » Mon Nov 10, 2014 11:41 pm

Dragancesu , gracias por compartir .....
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`.HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. : +54901169026142
Telegram Name : DaNiElMaXiMiLiAnO

User avatar
esgici
Posts: 4509
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Has thanked: 386 times
Been thanked: 111 times
Contact:

Post by esgici » Tue Nov 11, 2014 12:56 am

dragancesu wrote:I tried to make a simple system to log on to the system, you just need to compile...
(When pressed escape key)

Error BASE/1066 Argument error: conditional

Called from AT_LOGIN(49)
Called from (b)LOGIN(23)
Called from _DOCONTROLEVENTPROCEDURE(5745)
Called from EVENTS(803)
Called from DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(5413)
Called from LOGIN(43)
Called from ON_START(74)
Called from (b)MAIN(30)
Called from _PROCESSINITPROCEDURE(5567)
Called from _ACTIVATEWINDOW(5318)
Called from MAIN(65)


Second problem : advised "user" ("admin") is lovercase and textbox property is uppercase; problem with non-english caharacters.
Viva INTERNATIONAL HMG :D

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue Nov 11, 2014 1:03 am

danielmaximiliano wrote:Dragancesu , gracias por compartir .....
+1

User avatar
dragancesu
Posts: 672
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

Post by dragancesu » Tue Nov 11, 2014 7:59 am

Thanks for your comments

I tried to make a simple login system and I think I did, I saw that there is an error, the program has changed many times that I forgot to test it all again, the solution is

ON ESCAPE KEY ACTION at_login (.f.)

The most important function is code_pass that needs to hide some encryption password, the program is given as it may seem, initially placed combination admin / admin that should work, do not use UTF but I tried it with non-standard letters of the Latin alphabet and working šđžćč

in Clipper I used the C function and to

Code: Select all

CLIPPER CODEPASS(void)
{
	unsigned int i, j, c, c1, c2;
	char _in[20], _out[22], c11, c22;

	strcpy( _out, "                    " );
	strcpy( _in, _parc(1) );
	j = _parclen(1);

	if (j > 10) j = 10;

	if (j < 10)
	for(i=j;i<10;i++) strcat(_in," "); j = 10;

	for(i=0;i<j;i++)
	{
		c = _in[i]; c1 = c / 10; c2 = c - ( c1 * 10 );
		c11 = c1 + 200; c22 = c2 + 200;
		_out[i*2] = c11; _out[i*2+1] = c22;
	};

	_retc( _out );
}

User avatar
srvet_claudio
Posts: 2044
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Has thanked: 35 times
Been thanked: 146 times
Contact:

Post by srvet_claudio » Tue Nov 11, 2014 3:03 pm

dragancesu wrote:Thanks for your comments

I tried to make a simple login system and I think I did, I saw that there is an error, the program has changed many times that I forgot to test it all again, the solution is

ON ESCAPE KEY ACTION at_login (.f.)

The most important function is code_pass that needs to hide some encryption password, the program is given as it may seem, initially placed combination admin / admin that should work, do not use UTF but I tried it with non-standard letters of the Latin alphabet and working šđžćč

in Clipper I used the C function and to

Code: Select all

CLIPPER CODEPASS(void)
{
	unsigned int i, j, c, c1, c2;
	char _in[20], _out[22], c11, c22;

	strcpy( _out, "                    " );
	strcpy( _in, _parc(1) );
	j = _parclen(1);

	if (j > 10) j = 10;

	if (j < 10)
	for(i=j;i<10;i++) strcat(_in," "); j = 10;

	for(i=0;i<j;i++)
	{
		c = _in[i]; c1 = c / 10; c2 = c - ( c1 * 10 );
		c11 = c1 + 200; c22 = c2 + 200;
		_out[i*2] = c11; _out[i*2+1] = c22;
	};

	_retc( _out );
}
This is in HMG:

Code: Select all

HB_FUNC ( CODEPASS )
{
   unsigned int i, j, c, c1, c2;
   TCHAR _in[20], _out[22], c11, c22;

   lstrcpy ( _out, _TEXT("                    ") );
   lstrcpy ( _in, HMG_parc(1) );
   j = lstrlen ( HMG_parc(1) );

   if (j > 10) j = 10;

   if (j < 10)
   for(i=j;i<10;i++) lstrcat(_in,_TEXT(" ")); j = 10;

   for(i=0;i<j;i++)
   {
      c = _in[i]; c1 = c / 10; c2 = c - ( c1 * 10 );
      c11 = c1 + 200; c22 = c2 + 200;
      _out[i*2] = c11; _out[i*2+1] = c22;
   };

   HMG_retc( _out );
}
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César » Tue Nov 11, 2014 3:18 pm

Thank you Dragan and Claudio for your contribs. Would you please give us an example how to add CODEPASS ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México
Has thanked: 1 time
Been thanked: 2 times

Post by Javier Tovar » Tue Nov 11, 2014 4:46 pm

Pablo César wrote:Thank you Dragan and Claudio for your contribs. Would you please give us an example how to add CODEPASS ?
+1

User avatar
dragancesu
Posts: 672
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 21 times
Been thanked: 135 times

Post by dragancesu » Tue Nov 11, 2014 8:18 pm

Codepass not a specific function, in Clipper is done in C in that it could not "decompile", in the harbor this is not necessary because the real C programs.

in this login system is designed code_pass function that make you want to hide the password, it can be simple or complicated, your choices

User avatar
Agil Abdullah
Posts: 204
Joined: Mon Aug 25, 2014 11:57 am
Location: Jakarta, Indonesia
Contact:

Post by Agil Abdullah » Wed Nov 12, 2014 8:48 am

Thanks to Dragancesu & Dr.Soto for sharing.
Agil Abdullah Albatati (just call me Agil)
Programmer Never Surrender

Post Reply