Sign in to follow this  
Followers 0
nevodj

USER MANAGEMENT CONSOLE

4 posts in this topic

Hi

Wondering if someone can help a bit of a beginner with some code... or give me some ideas / advice.

I'm building a user management console for my app to mange user login details and permissions.

The code for the GUI only (no functionality yet) is below with a screen print attached.

Basically I need to know the best way to save the data entered and return all the user info to the list box...

.ini file or SQL database or....??

You could save a string like:

TomS, Tom, Smith, H74G5Df3 (Encrypted password), tom@email.co, Read | Write | Delete | Create | AccessToAdminConsole (String containing permissions)

Only problem is i dont know how to save this and return it to the list box and to the edit boxes etc for editing.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$AdminGui = GUICreate("Administrator Console", 555, 336, -1, -1)
$Label1 = GUICtrlCreateLabel("Login", 272, 26, 30, 17)
$Label2 = GUICtrlCreateLabel("First Name", 272, 52, 54, 17)
$Label3 = GUICtrlCreateLabel("Last Name", 272, 77, 55, 17)
$Label4 = GUICtrlCreateLabel("Password", 272, 103, 50, 17)
$Label5 = GUICtrlCreateLabel("Email", 272, 129, 29, 17)
$Label6 = GUICtrlCreateLabel("Available Permissions", 270, 161, 113, 17)
$Label7 = GUICtrlCreateLabel("Selected Permissions", 424, 161, 112, 17)
$List2 = GUICtrlCreateList("", 264, 186, 121, 97)
GUICtrlSetData(-1, "")
$List3 = GUICtrlCreateList("", 423, 186, 121, 97)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton(">", 392, 205, 27, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("<", 392, 239, 27, 24, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Save", 464, 296, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("New", 374, 296, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("", 352, 24, 121, 21)
$Input2 = GUICtrlCreateInput("", 352, 50, 121, 21)
$Input3 = GUICtrlCreateInput("", 352, 75, 121, 21)
$Input4 = GUICtrlCreateInput("", 352, 101, 121, 21)
$Input5 = GUICtrlCreateInput("", 352, 127, 121, 21)
$UserList = GUICtrlCreateListView("Login|Last Name|First Name", 8, 24, 250, 302, Default, $LVS_EX_GRIDLINES)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 66)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 90)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 90)
GUISetState(@SW_SHOW)
 
While 1
$Msg = GUIGetMsg()
Switch $Msg
  Case $GUI_EVENT_CLOSE
   Exit
EndSwitch
WEnd

Appreciate any tips.

Thanks

adminscreen.bmp

Share this post


Link to post
Share on other sites



Have you looked at filewrite() and fileread()?

Share this post


Link to post
Share on other sites

Yep... but could you parse it good enough?

Mainly where i'm stuck is putting the strings back in to the list box.

e.g if you had 30 users with strings like above.

Share this post


Link to post
Share on other sites

Look at stringsplit() to break it back up after reading. ex:

$entry =  'TomS, Tom, Smith, H74G5Df3,  tom@email.co, Read | Write | Delete | Create | AccessToAdminConsole'
$aSplitData = StringSplit($entry, ',')

Will give you and array with:

$aSplitData[1] = TomS

$aSplitData[2] = Tom

and so on

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0