config.h
stamp-h1
tests/test
-tools/zakauthdb-mkpwd
+tools/zakauthedb-mkpwd
*.tar.gz
*.exe
-compile
\ No newline at end of file
+compile
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([libzakauthdb], [0.5.0], [azagli@libero.it])
+AC_INIT([libzakauthedb], [0.5.0], [azagli@libero.it])
AC_CONFIG_SRCDIR([src/aute_db.c])
AC_CONFIG_HEADER([config.h])
AC_PROG_LIBTOOL
# Checks for libraries.
-PKG_CHECK_MODULES(LIBAUTEDB, [libzakauth >= 0.5.0
+PKG_CHECK_MODULES(LIBAUTEDB, [libzakauthe >= 0.5.0
libgtkform >= 0.5.0])
AC_SUBST(LIBAUTEDB_CFLAGS)
tests/Makefile
tools/Makefile
data/Makefile
- data/libzakauthdb/Makefile
- data/libzakauthdb/form/Makefile
- data/libzakauthdb/gui/Makefile
+ data/libzakauthedb/Makefile
+ data/libzakauthedb/form/Makefile
+ data/libzakauthedb/gui/Makefile
])
AC_OUTPUT
-SUBDIRS = libzakauthdb
+SUBDIRS = libzakauthedb
EXTRA_DIST = autedb_confi_schema.xml \
autedb.sql
+++ /dev/null
-SUBDIRS = gui form
+++ /dev/null
-formdir = $(datadir)/libaute-db/form
-
-form_DATA = user.form
-
-EXTRA_DIST = $(form_DATA)
+++ /dev/null
-<?xml version="1.0"?>
-<gtkform>
-
- <table>users</table>
-
- <widget type="entry" name="entry1" label="label6">
- <field type="text" name="code">
- <is-key>t</is-key>
- <obligatory>t</obligatory>
- </field>
- </widget>
-
- <widget type="label" name="label14">
- <field type="text" name="password">
- </field>
- </widget>
-
- <widget type="entry" name="entry2" label="label7">
- <field type="text" name="surname">
- <obligatory>t</obligatory>
- </field>
- </widget>
-
- <widget type="entry" name="entry3" label="label8">
- <field type="text" name="name" />
- </widget>
-
- <widget type="checkbox" name="checkbutton1" label="label9">
- <field type="boolean" name="enabled">
- <default>t</default>
- </field>
- </widget>
-
- <widget type="entry" name="entry4" label="label11">
- <field type="datetime" name="password_expiration">
- <datetime-type>datetime</datetime-type>
- <display-format>%d/%m/%Y %H.%M.%S</display-format>
- </field>
- </widget>
-
- <widget type="textview" name="textview1" label="label12">
- <field type="text" name="notes" />
- </widget>
-
-</gtkform>
+++ /dev/null
-guidir = $(datadir)/libaute-db/gui
-
-gui_DATA = autedb.gui
-
-EXTRA_DIST = $(gui_DATA)
+++ /dev/null
-<?xml version="1.0"?>
-<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy project-wide -->
- <object class="GtkDialog" id="diag_main">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Autenticazione</property>
- <property name="modal">True</property>
- <property name="window_position">center</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">5</property>
- <property name="row_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Utente</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Password</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txt_utente">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txt_password">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkExpander" id="exp_cambio">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <object class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">5</property>
- <property name="row_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Nuova</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Conferma</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txt_password_nuova">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="txt_password_conferma">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Cambia password</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="cancelbutton1">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="okbutton1">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="-6">cancelbutton1</action-widget>
- <action-widget response="-5">okbutton1</action-widget>
- </action-widgets>
- </object>
- <object class="GtkListStore" id="lstore_users">
- <columns>
- <!-- column-name status -->
- <column type="gchararray"/>
- <!-- column-name code -->
- <column type="gchararray"/>
- <!-- column-name surname_name -->
- <column type="gchararray"/>
- <!-- column-name password_expiration -->
- <column type="gchararray"/>
- </columns>
- </object>
- <object class="GtkWindow" id="w_users_list">
- <child>
- <object class="GtkVBox" id="vbx_users_list">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTreeView" id="treeview1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="model">lstore_users</property>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
- <property name="title">Status</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext1"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn3">
- <property name="title">Code</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext3"/>
- <attributes>
- <attribute name="text">1</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn2">
- <property name="title">Name</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext2"/>
- <attributes>
- <attribute name="text">2</attribute>
- </attributes>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn5">
- <property name="title">Password expiration</property>
- <child>
- <object class="GtkCellRendererText" id="cellrenderertext5"/>
- <attributes>
- <attribute name="text">3</attribute>
- </attributes>
- </child>
- </object>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button1">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button2">
- <property name="label">gtk-edit</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button3">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button4">
- <property name="label">gtk-find</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <object class="GtkWindow" id="w_user">
- <property name="title" translatable="yes">User</property>
- <property name="modal">True</property>
- <property name="window_position">center-on-parent</property>
- <property name="destroy_with_parent">True</property>
- <child>
- <object class="GtkVBox" id="vbox1">
- <property name="visible">True</property>
- <property name="border_width">5</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
- <child>
- <object class="GtkTable" id="table3">
- <property name="visible">True</property>
- <property name="n_rows">7</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">5</property>
- <property name="row_spacing">5</property>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Code</property>
- </object>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Surname</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Name</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label9">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Enabled</property>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label11">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Password expiration</property>
- </object>
- <packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label12">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="label" translatable="yes">Description</property>
- </object>
- <packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="checkbutton1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">10</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">100</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry3">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">100</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="entry4">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">19</property>
- <property name="invisible_char">●</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow" id="scrolledwindow2">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">etched-in</property>
- <child>
- <object class="GtkTextView" id="textview1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label14">
- <property name="label" translatable="yes">lbl_password</property>
- </object>
- <packing>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkHButtonBox" id="hbuttonbox2">
- <property name="visible">True</property>
- <property name="spacing">5</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="button5">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button6">
- <property name="label">gtk-save</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
-</interface>
--- /dev/null
+SUBDIRS = gui form
--- /dev/null
+formdir = $(datadir)/libaute-db/form
+
+form_DATA = user.form
+
+EXTRA_DIST = $(form_DATA)
--- /dev/null
+<?xml version="1.0"?>
+<gtkform>
+
+ <table>users</table>
+
+ <widget type="entry" name="entry1" label="label6">
+ <field type="text" name="code">
+ <is-key>t</is-key>
+ <obligatory>t</obligatory>
+ </field>
+ </widget>
+
+ <widget type="label" name="label14">
+ <field type="text" name="password">
+ </field>
+ </widget>
+
+ <widget type="entry" name="entry2" label="label7">
+ <field type="text" name="surname">
+ <obligatory>t</obligatory>
+ </field>
+ </widget>
+
+ <widget type="entry" name="entry3" label="label8">
+ <field type="text" name="name" />
+ </widget>
+
+ <widget type="checkbox" name="checkbutton1" label="label9">
+ <field type="boolean" name="enabled">
+ <default>t</default>
+ </field>
+ </widget>
+
+ <widget type="entry" name="entry4" label="label11">
+ <field type="datetime" name="password_expiration">
+ <datetime-type>datetime</datetime-type>
+ <display-format>%d/%m/%Y %H.%M.%S</display-format>
+ </field>
+ </widget>
+
+ <widget type="textview" name="textview1" label="label12">
+ <field type="text" name="notes" />
+ </widget>
+
+</gtkform>
--- /dev/null
+guidir = $(datadir)/libaute-db/gui
+
+gui_DATA = autedb.gui
+
+EXTRA_DIST = $(gui_DATA)
--- /dev/null
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkDialog" id="diag_main">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Autenticazione</property>
+ <property name="modal">True</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">5</property>
+ <property name="row_spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Utente</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="txt_utente">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="txt_password">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkExpander" id="exp_cambio">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">5</property>
+ <property name="row_spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Nuova</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Conferma</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="txt_password_nuova">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="txt_password_conferma">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="activates_default">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Cambia password</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="okbutton1">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton1</action-widget>
+ <action-widget response="-5">okbutton1</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkListStore" id="lstore_users">
+ <columns>
+ <!-- column-name status -->
+ <column type="gchararray"/>
+ <!-- column-name code -->
+ <column type="gchararray"/>
+ <!-- column-name surname_name -->
+ <column type="gchararray"/>
+ <!-- column-name password_expiration -->
+ <column type="gchararray"/>
+ </columns>
+ </object>
+ <object class="GtkWindow" id="w_users_list">
+ <child>
+ <object class="GtkVBox" id="vbx_users_list">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTreeView" id="treeview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="model">lstore_users</property>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <property name="title">Status</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <property name="title">Code</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext3"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <property name="title">Name</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext2"/>
+ <attributes>
+ <attribute name="text">2</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn" id="treeviewcolumn5">
+ <property name="title">Password expiration</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext5"/>
+ <attributes>
+ <attribute name="text">3</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button1">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button2">
+ <property name="label">gtk-edit</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button3">
+ <property name="label">gtk-delete</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button4">
+ <property name="label">gtk-find</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkWindow" id="w_user">
+ <property name="title" translatable="yes">User</property>
+ <property name="modal">True</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="destroy_with_parent">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox1">
+ <property name="visible">True</property>
+ <property name="border_width">5</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkTable" id="table3">
+ <property name="visible">True</property>
+ <property name="n_rows">7</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">5</property>
+ <property name="row_spacing">5</property>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Code</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Surname</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Enabled</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password expiration</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label12">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="label" translatable="yes">Description</property>
+ </object>
+ <packing>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">10</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">100</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry3">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">100</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry4">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="max_length">19</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">etched-in</property>
+ <child>
+ <object class="GtkTextView" id="textview1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label14">
+ <property name="label" translatable="yes">lbl_password</property>
+ </object>
+ <packing>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox2">
+ <property name="visible">True</property>
+ <property name="spacing">5</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="button5">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button6">
+ <property name="label">gtk-save</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
-guidir = $(datadir)/libzakauthdb/gui
-formdir = $(datadir)/libzakauthdb/form
+guidir = $(datadir)/libzakauthedb/gui
+formdir = $(datadir)/libzakauthedb/form
AM_CPPFLAGS = $(LIBAUTEDB_CFLAGS) \
$(LIBGCRYPT_CFLAGS) \
$(GPG_ERROR_LIBS) \
$(LIBCONFI_LIBS)
-libzakauth_pluginsdir = $(libdir)/libzakauth/plugins
-libzakauth_plugins_LTLIBRARIES = libzakauthdb.la
+libzakauthe_pluginsdir = $(libdir)/libzakauthe/plugins
+libzakauthe_plugins_LTLIBRARIES = libzakauthedb.la
-libzakauthdb_la_SOURCES = aute_db.c \
+libzakauthedb_la_SOURCES = aute_db.c \
aute_db.h \
user.c \
user.h
-libzakauthdb_la_LDFLAGS = -no-undefined
+libzakauthedb_la_LDFLAGS = -no-undefined
{
gboolean ret = TRUE;
- *cnc_string = confi_path_get_value (confi, "libzakauth/libzakauthdb/db/cnc_string");
+ *cnc_string = confi_path_get_value (confi, "libzakauthe/libzakauthedb/db/cnc_string");
if (*cnc_string == NULL
|| strcmp (g_strstrip (*cnc_string), "") == 0)
gdaex = gdaex_new_from_string (cnc_string);
if (gdaex == NULL)
{
- g_warning ("Unable to establish a db connection.");
+ g_warning ("Unable to establish a connection to the database.");
}
}
}
/**
- * zak_auth_db_encrypt_password:
+ * zak_authe_db_encrypt_password:
* @password: una stringa da cifrare.
*
* Returns: the @password encrypted.
*/
gchar
-*zak_auth_db_encrypt_password (const gchar *password)
+*zak_authe_db_encrypt_password (const gchar *password)
{
gchar digest[17] = "";
gchar pwd_gcrypt[33] = "";
" AND password = '%s'"
" AND status <> 'E'",
gdaex_strescape (utente, NULL),
- gdaex_strescape (zak_auth_db_encrypt_password (password), NULL));
+ gdaex_strescape (zak_authe_db_encrypt_password (password), NULL));
dm = gdaex_query (gdaex, sql);
g_free (sql);
if (dm == NULL || gda_data_model_get_n_rows (dm) <= 0)
sql = g_strdup_printf ("UPDATE users"
" SET password = '%s'"
" WHERE code = '%s'",
- gdaex_strescape (zak_auth_db_encrypt_password (password_nuova), NULL),
+ gdaex_strescape (zak_authe_db_encrypt_password (password_nuova), NULL),
gdaex_strescape (utente, NULL));
if (gdaex_execute (gdaex, sql) == -1)
{
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- "You must before select a user.");
+ "You need to select a user.");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION,
GTK_BUTTONS_YES_NO,
- "Sicuro di voler eliminare l'utente selezionato?");
+ "Are you sure to want to delete the selected user?");
risp = gtk_dialog_run (GTK_DIALOG (dialog));
if (risp == GTK_RESPONSE_YES)
{
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
- "Occorre prima selezionare un modello");
+ "You need to select a user.");
gtk_dialog_run (GTK_DIALOG (dialog));
gtk_widget_destroy (dialog);
}
/* PUBLIC */
gchar
-*zak_auth_auth (GSList *parameters)
+*zak_authe_authe (GSList *parameters)
{
GError *error;
gchar *ret = NULL;
*
*/
GtkWidget
-*zak_auth_plg_get_management_gui (GSList *parameters)
+*zak_authe_plg_get_management_gui (GSList *parameters)
{
GError *error;
gchar *GUIDIR;
- GUIDIR = g_build_filename (g_win32_get_package_installation_directory_of_module (NULL), "share", "libzakauthdb", "gui", NULL);
+ GUIDIR = g_build_filename (g_win32_get_package_installation_directory_of_module (NULL), "share", "libzakauthedb", "gui", NULL);
#endif
if (!gtk_builder_add_objects_from_file (gtkbuilder, g_build_filename (GUIDIR, "autedb.gui", NULL),
g_strsplit ("lstore_users|vbx_users_list", "|", -1),
&error))
{
- g_error ("Impossibile trovare il file di definizione dell'interfaccia utente.");
+ g_error ("Unable to find the gui definition file.");
return NULL;
}
*
*/
-#ifndef __ZAKAUTHDB_H__
-#define __ZAKAUTHDB_H__
+#ifndef __ZAKAUTHEDB_H__
+#define __ZAKAUTHEDB_H__
G_BEGIN_DECLS
-gchar *zak_auth_db_encrypt_password (const gchar *password);
+gchar *zak_authe_db_encrypt_password (const gchar *password);
G_END_DECLS
-#endif /* __ZAKAUTHDB_H__ */
+#endif /* __ZAKAUTHEDB_H__ */
/*
- * Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-2015 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
if (priv->code == NULL || g_strcmp0 (priv->code, "") == 0)
{
gtk_label_set_text (GTK_LABEL (priv->objects[LBL_PASSWORD]),
- zak_auth_db_encrypt_password (gtk_entry_get_text (GTK_ENTRY (priv->objects[TXT_CODE]))));
+ zak_authe_db_encrypt_password (gtk_entry_get_text (GTK_ENTRY (priv->objects[TXT_CODE]))));
sql = gtk_form_get_sql (priv->form, GTK_FORM_SQL_INSERT);
}
else
-/*
- * Copyright (C) 2010-2011 Andrea Zagli <azagli@libero.it>
+/*
+ * Copyright (C) 2010-2015 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
LIBS = $(GTK_LIBS) \
$(LIBAUTEDB_LIBS)
-LDADD = ../src/libzakauthdb.la
+LDADD = ../src/libzakauthedb.la
noinst_PROGRAMS = test
#include <gtk/gtk.h>
-#include <libzakauth.h>
+#include <libzakauthe.h>
int
main (int argc, char **argv)
{
- ZakAuth *aute;
+ ZakAuthe *aute;
GSList *params;
gtk_init (&argc, &argv);
- aute = zak_auth_new ();
+ aute = zak_authe_new ();
/* the libaute module to use */
params = g_slist_append (params, argv[1]);
/* the libgda connection string */
params = g_slist_append (params, argv[2]);
- zak_auth_set_config (aute, params);
+ zak_authe_set_config (aute, params);
- g_message ("User %s\n", zak_auth_auth (aute));
+ g_message ("User %s\n", zak_authe_authe (aute));
return 0;
}
LIBS = $(LIBAUTEDB_LIBS) \
$(LIBGCRYPT_LIBS)
-noinst_PROGRAMS = zakauthdb-mkpwd
+noinst_PROGRAMS = zakauthedb-mkpwd
-zakauthdb_mkpwd_SOURCES = zakauthdb_mkpwd.c
+zakauthedb_mkpwd_SOURCES = zakauthedb_mkpwd.c
+++ /dev/null
-/*
- * Copyright (C) 2006 Andrea Zagli <azagli@libero.it>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include <glib.h>
-#include <glib/gprintf.h>
-#include <gcrypt.h>
-
-/**
- * cifra_password:
- * @password: una stringa da cifrare.
- *
- * Return: la @password cifrata.
- */
-static gchar
-*cifra_password (const gchar *password)
-{
- gchar digest[17] = "";
- gchar pwd_gcrypt[33] = "";
- gint i;
-
- if (strcmp (password, "") != 0)
- {
- gcry_md_hash_buffer (GCRY_MD_MD5, &digest, password, strlen (password));
- for (i = 0; i < 16; i++)
- {
- g_sprintf (pwd_gcrypt + (i * 2), "%02x", digest[i] & 0xFF);
- }
- pwd_gcrypt[32] = '\0';
- }
-
- return g_strdup (&pwd_gcrypt[0]);
-}
-
-int
-main (int argc, char **argv)
-{
- gchar *pwd = NULL;
- GOptionEntry entries[] =
- {
- { "password", 'p', 0, G_OPTION_ARG_STRING, &pwd, "La stringa da cifrare", NULL },
- { NULL }
- };
-
- GOptionContext *context;
- GError *error = NULL;
-
- /* gestione degli argomenti della riga di comando */
- context = g_option_context_new ("");
- g_option_context_add_main_entries (context, entries, NULL);
- if (!g_option_context_parse (context, &argc, &argv, &error))
- {
- /* TO DO */
- g_printf ("Errore argomenti riga comando.\n");
- return 0;
- }
-
- if (pwd == NULL || strcmp (g_strstrip (pwd), "") == 0)
- {
- g_printf ("Occorre specificare la stringa da cifrare.\n");
- return 0;
- }
-
- g_printf ("%s\n", cifra_password (pwd));
-
- return 0;
-}
--- /dev/null
+/*
+ * Copyright (C) 2006-2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <gcrypt.h>
+
+/**
+ * cifra_password:
+ * @password: una stringa da cifrare.
+ *
+ * Return: la @password cifrata.
+ */
+static gchar
+*cifra_password (const gchar *password)
+{
+ gchar digest[17] = "";
+ gchar pwd_gcrypt[33] = "";
+ gint i;
+
+ if (strcmp (password, "") != 0)
+ {
+ gcry_md_hash_buffer (GCRY_MD_MD5, &digest, password, strlen (password));
+ for (i = 0; i < 16; i++)
+ {
+ g_sprintf (pwd_gcrypt + (i * 2), "%02x", digest[i] & 0xFF);
+ }
+ pwd_gcrypt[32] = '\0';
+ }
+
+ return g_strdup (&pwd_gcrypt[0]);
+}
+
+int
+main (int argc, char **argv)
+{
+ gchar *pwd = NULL;
+ GOptionEntry entries[] =
+ {
+ { "password", 'p', 0, G_OPTION_ARG_STRING, &pwd, "The string to encrypt", NULL },
+ { NULL }
+ };
+
+ GOptionContext *context;
+ GError *error = NULL;
+
+ /* gestione degli argomenti della riga di comando */
+ context = g_option_context_new ("");
+ g_option_context_add_main_entries (context, entries, NULL);
+ if (!g_option_context_parse (context, &argc, &argv, &error))
+ {
+ /* TO DO */
+ g_printf ("Error on command line arguments.\n");
+ return 0;
+ }
+
+ if (pwd == NULL || strcmp (g_strstrip (pwd), "") == 0)
+ {
+ g_printf ("You need to provide the string to encrypt.\n");
+ return 0;
+ }
+
+ g_printf ("%s\n", cifra_password (pwd));
+
+ return 0;
+}