Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Problem in setting Password

3 replies · 3,150 views · Started 21 June 2005

Hey Guys,

I am not able to set the password for a Symbian device. I am using Nokia 6600 for my testing.
Following code snippets will give you an idea of what I am doing..

//===================================================
// Code to take input from user, oldpassword and newpassword that needs to be set
//====================================================

TBuf<KAknExQueryTextBufLength> oldpassword;
CAknTextQueryDialog* dlg =
new ( ELeave ) CAknTextQueryDialog(
oldpassword, CAknQueryDialog::ENoTone );
if ( ! dlg->ExecuteLD( R_DIALOG_OLD_PASSWORD_QUERY ) )
{
return;
}

Similarly, i get the new password as well.

//===================================================
// Set password, and enable password checking if not enabled.
//====================================================

if(Password::IsEnabled())
{
if(Password::Set(oldpassword, newpassword ))
{
// print message, password set
}
else
{
// print, error message saying password not set
}
}
else
{
// enable password checking
Password::SetEnabled(oldPassword, ETrue);
// set password
Password::Set(oldpassword, newpassword ) ;
}

Even though I get messages saying password is enabled and set, but actually it does not set any password.
Moreover, when I tried to check if password that I am trying to set is valid using Password::IsValid(), it always returns false i.e password is not valid, though Password::Set() return true 😞

Please let me know if I am missing anything. Any help will be really appreciated.

Thanks a lot,
Sachin

Hello sir,

Iam working on the same task i.e password protection for the mobiles or the user authentication. I hop by now you have successfully completed the task described above which was incomplete before. Can u please help me by posting the source code. Iam a symbian beginner in developing, krishna from india.

I will be waiting for ur reply.

batistabomb

Sachin Kumar wrote:Hey Guys,

I am not able to set the password for a Symbian device. I am using Nokia 6600 for my testing.
Following code snippets will give you an idea of what I am doing..

//===================================================
// Code to take input from user, oldpassword and newpassword that needs to be set
//====================================================

TBuf<KAknExQueryTextBufLength> oldpassword;
CAknTextQueryDialog* dlg =
new ( ELeave ) CAknTextQueryDialog(
oldpassword, CAknQueryDialog::ENoTone );
if ( ! dlg->ExecuteLD( R_DIALOG_OLD_PASSWORD_QUERY ) )
{
return;
}

Similarly, i get the new password as well.

//===================================================
// Set password, and enable password checking if not enabled.
//====================================================

if(Password::IsEnabled())
{
if(Password::Set(oldpassword, newpassword ))
{
// print message, password set
}
else
{
// print, error message saying password not set
}
}
else
{
// enable password checking
Password::SetEnabled(oldPassword, ETrue);
// set password
Password::Set(oldpassword, newpassword ) ;
}

Even though I get messages saying password is enabled and set, but actually it does not set any password.
Moreover, when I tried to check if password that I am trying to set is valid using Password::IsValid(), it always returns false i.e password is not valid, though Password::Set() return true 😞

Please let me know if I am missing anything. Any help will be really appreciated.

Thanks a lot,
Sachin

I want the complete code for setting password protection to the mobiles. I have sent this msg many times.

batistabomb wrote:Hello sir,

Iam working on the same task i.e password protection for the mobiles or the user authentication. I hop by now you have successfully completed the task described above which was incomplete before. Can u please help me by posting the source code. Iam a symbian beginner in developing, krishna from india.

I will be waiting for ur reply.

batistabomb

Mr sachin Can u send me the code for setting password. i nedd it in order to use in different application. please try to help me

batistabomb wrote:Hello sir,

Iam working on the same task i.e password protection for the mobiles or the user authentication. I hop by now you have successfully completed the task described above which was incomplete before. Can u please help me by posting the source code. Iam a symbian beginner in developing, krishna from india.

I will be waiting for ur reply.

batistabomb