config.h
stamp-h1
tests/test
-tools/aute-db-mkpwd
+tools/zakauthdb-mkpwd
*.tar.gz
-*.exe
\ No newline at end of file
+*.exe
+compile
\ No newline at end of file
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
-PKG_NAME="libaute-db"
+PKG_NAME="libzakauthdb"
(test -f $srcdir/configure.ac \
&& test -d $srcdir/src \
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([libaute-db], [0.5.0], [azagli@libero.it])
+AC_INIT([libzakauthdb], [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, [libaute >= 0.2.0
+PKG_CHECK_MODULES(LIBAUTEDB, [libzakauth >= 0.5.0
libgtkform >= 0.5.0])
AC_SUBST(LIBAUTEDB_CFLAGS)
tests/Makefile
tools/Makefile
data/Makefile
- data/libaute-db/Makefile
- data/libaute-db/form/Makefile
- data/libaute-db/gui/Makefile
+ data/libzakauthdb/Makefile
+ data/libzakauthdb/form/Makefile
+ data/libzakauthdb/gui/Makefile
])
AC_OUTPUT
-SUBDIRS = libaute-db
+SUBDIRS = libzakauthdb
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)/libaute-db/gui
-formdir = $(datadir)/libaute-db/form
+guidir = $(datadir)/libzakauthdb/gui
+formdir = $(datadir)/libzakauthdb/form
AM_CPPFLAGS = $(LIBAUTEDB_CFLAGS) \
$(LIBGCRYPT_CFLAGS) \
$(GPG_ERROR_LIBS) \
$(LIBCONFI_LIBS)
-libaute_pluginsdir = $(libdir)/libaute/plugins
-libaute_plugins_LTLIBRARIES = libaute-db.la
+libzakauth_pluginsdir = $(libdir)/libzakauth/plugins
+libzakauth_plugins_LTLIBRARIES = libzakauthdb.la
-libaute_db_la_SOURCES = aute_db.c \
+libzakauthdb_la_SOURCES = aute_db.c \
aute_db.h \
user.c \
user.h
-libaute_db_la_LDFLAGS = -no-undefined
+libzakauthdb_la_LDFLAGS = -no-undefined
/*
- * Copyright (C) 2005-2011 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2005-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
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-
+
+#include <glib/gprintf.h>
#include <gtk/gtk.h>
#include <gcrypt.h>
#include <libgdaex/libgdaex.h>
static GtkBuilder *gtkbuilder;
static GdaEx *gdaex;
+static gchar *guidir;
static gchar *guifile;
static gchar *formdir;
{
gboolean ret = TRUE;
- *cnc_string = confi_path_get_value (confi, "aute/aute-db/db/cnc_string");
+ *cnc_string = confi_path_get_value (confi, "libzakauth/libzakauthdb/db/cnc_string");
if (*cnc_string == NULL
|| strcmp (g_strstrip (*cnc_string), "") == 0)
}
/**
- * autedb_cifra_password:
+ * zak_auth_db_encrypt_password:
* @password: una stringa da cifrare.
*
- * Return: la @password cifrata.
+ * Returns: the @password encrypted.
*/
gchar
-*autedb_cifra_password (const gchar *password)
+*zak_auth_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 (autedb_cifra_password (password), NULL));
+ gdaex_strescape (zak_auth_db_encrypt_password (password), NULL));
dm = gdaex_query (gdaex, sql);
+ g_free (sql);
if (dm == NULL || gda_data_model_get_n_rows (dm) <= 0)
{
- g_warning ("Utente o password non validi.");
+ if (dm != NULL)
+ {
+ g_object_unref (dm);
+ }
+ g_warning ("User name or password aren't valids.");
return NULL;
}
else if (strcmp (g_strstrip (password_nuova), g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txt_password_conferma))))) != 0)
{
/* TO DO */
- g_warning ("La nuova password e la conferma non coincidono.");
+ g_warning ("The new and confirm password don't match.");
}
else
{
sql = g_strdup_printf ("UPDATE users"
" SET password = '%s'"
" WHERE code = '%s'",
- gdaex_strescape (autedb_cifra_password (password_nuova), NULL),
+ gdaex_strescape (zak_auth_db_encrypt_password (password_nuova), NULL),
gdaex_strescape (utente, NULL));
if (gdaex_execute (gdaex, sql) == -1)
{
gtk_window_set_transient_for (GTK_WINDOW (w), autedb_get_gtkwidget_parent_gtkwindow (w_users));
gtk_widget_show (w);
}
-
+
static void
autedb_on_btn_edit_clicked (GtkButton *button,
gpointer user_data)
{
autedb_edit_user ();
}
-
+
static void
autedb_on_btn_delete_clicked (GtkButton *button,
gpointer user_data)
gpointer user_data)
{
}
-
+
/* PUBLIC */
gchar
-*autentica (GSList *parameters)
+*zak_auth_auth (GSList *parameters)
{
GError *error;
gchar *ret = NULL;
gtkbuilder = gtk_builder_new ();
#ifdef G_OS_WIN32
- gchar *guidir;
gchar *moddir;
gchar *p;
*
*/
GtkWidget
-*get_management_gui (GSList *parameters)
+*zak_auth_plg_get_management_gui (GSList *parameters)
{
GError *error;
gchar *GUIDIR;
- GUIDIR = g_build_filename (g_win32_get_package_installation_directory_of_module (NULL), "share", "libaute-db", "gu", NULL);
+ GUIDIR = g_build_filename (g_win32_get_package_installation_directory_of_module (NULL), "share", "libzakauthdb", "gui", NULL);
#endif
if (!gtk_builder_add_objects_from_file (gtkbuilder, g_build_filename (GUIDIR, "autedb.gui", NULL),
-/*
- * 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
*
*/
-#ifndef __AUTEDB_H__
-#define __AUTEDB_H__
+#ifndef __ZAKAUTHDB_H__
+#define __ZAKAUTHDB_H__
G_BEGIN_DECLS
-gchar *autedb_cifra_password (const gchar *password);
+gchar *zak_auth_db_encrypt_password (const gchar *password);
G_END_DECLS
-#endif /* __AUTEDB_H__ */
+#endif /* __ZAKAUTHDB_H__ */
-/*
+/*
* Copyright (C) 2010 Andrea Zagli <azagli@libero.it>
*
* This library is free software; you can redistribute it and/or
if (priv->code == NULL || g_strcmp0 (priv->code, "") == 0)
{
gtk_label_set_text (GTK_LABEL (priv->objects[LBL_PASSWORD]),
- autedb_cifra_password (gtk_entry_get_text (GTK_ENTRY (priv->objects[TXT_CODE]))));
+ zak_auth_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
LIBS = $(GTK_LIBS) \
$(LIBAUTEDB_LIBS)
-LDADD = ../src/libaute-db.la
+LDADD = ../src/libzakauthdb.la
noinst_PROGRAMS = test
/*
- * Copyright (C) 2010-2013 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2010-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
#include <gtk/gtk.h>
-#include <libaute.h>
+#include <libzakauth.h>
int
main (int argc, char **argv)
{
- Aute *aute;
+ ZakAuth *aute;
GSList *params;
gtk_init (&argc, &argv);
- aute = aute_new ();
+ aute = zak_auth_new ();
/* the libaute module to use */
params = g_slist_append (params, argv[1]);
/* the libgda connection string */
params = g_slist_append (params, argv[2]);
- aute_set_config (aute, params);
+ zak_auth_set_config (aute, params);
- g_message ("User %s\n", aute_autentica (aute));
+ g_message ("User %s\n", zak_auth_auth (aute));
return 0;
}
LIBS = $(LIBAUTEDB_LIBS) \
$(LIBGCRYPT_LIBS)
-noinst_PROGRAMS = aute-db-mkpwd
+noinst_PROGRAMS = zakauthdb-mkpwd
-aute_db_mkpwd_SOURCES = aute_db_mkpwd.c
+zakauthdb_mkpwd_SOURCES = zakauthdb_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 <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 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;
+}