DAS  3.1.6 - 18/09/2017
Functions | Variables
PWD.C File Reference

DAS password request. More...

#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mgui.h"
#include "DAS_Spatram.h"
+ Include dependency graph for PWD.C:

Go to the source code of this file.

Functions

void ActPWDSysCB (MOBJECT edit, char *text, void *ed)
 
int MDCreateSh_PWD ()
 Password shell. Procedure that build the shell for the System password in order to access the control panel of the application. More...
 

Variables

short int NumRip = 0
 

Detailed Description

DAS password request.

Author
Daniele Bortoli

Definition in file PWD.C.

Function Documentation

§ ActPWDSysCB()

void ActPWDSysCB ( MOBJECT  edit,
char *  text,
void *  ed 
)

Definition at line 39 of file PWD.C.

References DPWD, False, dpwd::FlgSh_PWD, MEditSetTextExt(), NumRip, and dpwd::PwdOK.

Referenced by MDCreateSh_PWD().

40 {
41  static int notify;
42  char DefPwdSys[10]="nefertari";
43 
44  int DefPwdOk;
45 /*
46  * When 'notify' is True, the EDIT 'ed' calls
47  * the 'ValueChange' and 'NewValue' Callbacks
48  */
49 
50  sprintf(DefPwdSys, "%s","nefertari"); //Sistem Paswd
51 
52  DefPwdOk = strcmp( DefPwdSys, text );
53  if(DefPwdOk == 0)
54  {
55 
56  DPWD.FlgSh_PWD = 0;
57  DPWD.PwdOK = 0;
58  }
59  else
60  {
61  NumRip++;
62  if (NumRip == 3)
63  {
64 
65  DPWD.FlgSh_PWD = 0;
66  DPWD.PwdOK = 1;
67  NumRip = 0;
68 
69  }
70  sprintf(text, "", "");
71  notify ^= 1;
72  MEditSetTextExt((MOBJECT) ed, text, False, notify);
73  }
74 
75 // NumRip++;
76 // if (NumRip == 3)
77 // {
78 
79 // DPWD.FlgSh_PWD = 1;
80 // DPWD.PwdOK = 1;
81 
82 // }
83 
84 }
dpwd DPWD
Definition: CreateForms.c:79
void MEditSetTextExt(MOBJECT edit, const char *text, int validated, int notify)
int PwdOK
#define False
Definition: Mguidefs.h:236
int FlgSh_PWD
short int NumRip
Definition: PWD.C:28
void * MOBJECT
Definition: Mguidefs.h:192
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

§ MDCreateSh_PWD()

int MDCreateSh_PWD ( void  )

Password shell. Procedure that build the shell for the System password in order to access the control panel of the application.

Returns
void

Definition at line 105 of file PWD.C.

References ActPWDSysCB(), DAS, DPWD, FIXED_MEDIUM, FIXED_SMALL, dpwd::FlgSh_PWD, das::Gui, MCreateHiddenEdit(), MCreateLabel(), MCreateRowForm(), MCreateShell(), MEditSetActCallback(), MEditSetFilter(), MLoopWhileFlag(), MObjectSetBackgroundRGB(), MObjectSetForegroundRGB(), MObjectSetResize(), MShellDestroy(), MShellRaise(), MShellRealize(), MShellUnrealize(), dpwd::PwdOK, SF_MODAL, shells::Sh_PWD, gui::Shells, and True.

106 {
107 
108 
109  MOBJECT _rowform000;
110  MOBJECT _label000;
111  MOBJECT _edit000;
112  DAS.Gui.Shells.Sh_PWD = MCreateShell("SYSTEM PWD", SF_MODAL);
113 
114  _rowform000 = MCreateRowForm(DAS.Gui.Shells.Sh_PWD);
115  MObjectSetForegroundRGB(_rowform000, 88, 80, 96);
116  MObjectSetBackgroundRGB(_rowform000, 88, 80, 96);
117  MObjectSetResize(_rowform000, True, True);
118 
119  _label000 = MCreateLabel(_rowform000, "Please insert the system password", FIXED_SMALL);
120  MObjectSetForegroundRGB(_label000, 255, 255, 0);
121 
122  _edit000 = MCreateHiddenEdit(_rowform000, "", 15, FIXED_MEDIUM, '*');
123  MEditSetFilter(_edit000, 1, "");
124  MObjectSetForegroundRGB(_edit000, 255, 255, 255);
125  MObjectSetBackgroundRGB(_edit000, 0, 0, 0);
126  MEditSetActCallback(_edit000, ActPWDSysCB, _edit000);
127 
129 
131 
135 
136  return DPWD.PwdOK;
137 
138 }
dpwd DPWD
Definition: CreateForms.c:79
void MObjectSetBackgroundRGB(MOBJECT obj, int r, int g, int b)
gui Gui
Graphic User Interface Structure.
shells Shells
Shells structure.
void MShellRealize(MOBJECT obj)
int PwdOK
MOBJECT MCreateLabel(MOBJECT parent, const char *text, MTFont font)
void MObjectSetResize(MOBJECT obj, int resize_w, int resize_h)
int FlgSh_PWD
das DAS
Definition: Chktemp.c:26
void MShellUnrealize(MOBJECT obj)
void MShellDestroy(MOBJECT obj)
#define FIXED_MEDIUM
Definition: Mguidefs.h:879
void MEditSetActCallback(MOBJECT edit, OBJ_STRING_CB cb, void *data)
#define FIXED_SMALL
Definition: Mguidefs.h:878
#define SF_MODAL
Definition: Mguidefs.h:1019
MOBJECT MCreateHiddenEdit(MOBJECT parent, const char *text, int len, MTFont font, char shown_char)
MOBJECT MCreateShell(const char *title, int flags)
void MShellRaise(MOBJECT obj)
void ActPWDSysCB(MOBJECT edit, char *text, void *ed)
Definition: PWD.C:39
void MEditSetFilter(MOBJECT edit, int filter, const char *extra_chars)
void * MOBJECT
Definition: Mguidefs.h:192
#define True
Definition: Mguidefs.h:235
MOBJECT Sh_PWD
Password Shell.
void MLoopWhileFlag(int *pflag, int value)
void MObjectSetForegroundRGB(MOBJECT obj, int r, int g, int b)
MOBJECT MCreateRowForm(MOBJECT parent)
+ Here is the call graph for this function:

Variable Documentation

§ NumRip

short int NumRip = 0

Definition at line 28 of file PWD.C.

Referenced by ActPWDSysCB().

______________________________________________________________________________________
Generated on Mon Sep 18 2017 11:46:40 for DAS - Rel. 3.1.6 - 18/09/2017.