Users
- Se ha añadido la ejecución de un comando para crear el directorio de usuario al cambiar la contraseña - Número de versión aumentado
This commit is contained in:
parent
1d545953b0
commit
bba90b333e
|
@ -66,11 +66,13 @@ AC_ARG_VAR([UNINSTALLED_DIR], [the directory of the uninstalled hedera project])
|
||||||
|
|
||||||
PKG_PROG_PKG_CONFIG
|
PKG_PROG_PKG_CONFIG
|
||||||
|
|
||||||
|
VALAFLAGS+=" --pkg posix "
|
||||||
|
|
||||||
if test $UNINSTALLED_DIR; then
|
if test $UNINSTALLED_DIR; then
|
||||||
VALA_CHECK_MODULES(ACCOUNT, [gtk+-3.0])
|
VALA_CHECK_MODULES(ACCOUNT, [gtk+-3.0])
|
||||||
ACCOUNT_CFLAGS+=-I$UNINSTALLED_DIR
|
ACCOUNT_CFLAGS+=-I$UNINSTALLED_DIR
|
||||||
ACCOUNT_LIBS+=$UNINSTALLED_DIR/build/main/libhedera.la
|
ACCOUNT_LIBS+=$UNINSTALLED_DIR/build/main/libhedera.la
|
||||||
VALAFLAGS+="$ACCOUNT_VALAFLAGS --pkg gvn --pkg sql --pkg db --pkg vn --vapidir $UNINSTALLED_DIR/build/vapi "
|
VALAFLAGS+="$ACCOUNT_VALAFLAGS --pkg gvn --pkg sql --pkg db --pkg vn --vapidir $UNINSTALLED_DIR/build/vapi"
|
||||||
|
|
||||||
AC_SUBST(account_libdir, $libdir/hedera/module)
|
AC_SUBST(account_libdir, $libdir/hedera/module)
|
||||||
AC_SUBST(account_datadir, $datadir/hedera/module)
|
AC_SUBST(account_datadir, $datadir/hedera/module)
|
||||||
|
|
|
@ -15,4 +15,3 @@
|
||||||
</item>
|
</item>
|
||||||
</menu>
|
</menu>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
||||||
|
|
|
@ -261,13 +261,13 @@ WHERE #link</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="VnEntry" id="entry1">
|
<object class="VnEntry" id="name-entry">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="iterator">users-grid</property>
|
<property name="iterator">users-grid</property>
|
||||||
<property name="column_name">name</property>
|
<property name="column_name">name</property>
|
||||||
<child internal-child="widget">
|
<child internal-child="widget">
|
||||||
<object class="GtkEntry" id="entry-widget1">
|
<object class="GtkEntry" id="name-entry-widget">
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
hedera-account (1.0-7) UNRELEASED; urgency=low
|
hedera-account (1.0-8) UNRELEASED; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,14 @@ public class Vn.Users : Vn.Form
|
||||||
private unowned Gtk.Dialog password_dialog;
|
private unowned Gtk.Dialog password_dialog;
|
||||||
private unowned Vn.Entry password_entry;
|
private unowned Vn.Entry password_entry;
|
||||||
private unowned Vn.Entry repeat_password;
|
private unowned Vn.Entry repeat_password;
|
||||||
|
private unowned Gtk.Entry user_entry;
|
||||||
|
private string password;
|
||||||
|
private Sql.Batch batch;
|
||||||
|
|
||||||
public override void open ()
|
public override void open ()
|
||||||
{
|
{
|
||||||
password_entry = get ("password-entry") as Vn.Entry;
|
password_entry = get ("password-entry") as Vn.Entry;
|
||||||
|
user_entry = get ("name-entry-widget") as Gtk.Entry;
|
||||||
repeat_password = get ("repeat-password") as Vn.Entry;
|
repeat_password = get ("repeat-password") as Vn.Entry;
|
||||||
password_dialog = get ("password-dialog") as Gtk.Dialog;
|
password_dialog = get ("password-dialog") as Gtk.Dialog;
|
||||||
password_dialog.add_button (_("Cancel"), Gtk.ResponseType.CANCEL);
|
password_dialog.add_button (_("Cancel"), Gtk.ResponseType.CANCEL);
|
||||||
|
@ -62,8 +66,8 @@ public class Vn.Users : Vn.Form
|
||||||
{
|
{
|
||||||
if (response_id == Gtk.ResponseType.ACCEPT)
|
if (response_id == Gtk.ResponseType.ACCEPT)
|
||||||
{
|
{
|
||||||
var password = password_entry.value.get_string (),
|
password = password_entry.value.get_string ();
|
||||||
repeat = repeat_password.value.get_string ();
|
var repeat = repeat_password.value.get_string ();
|
||||||
|
|
||||||
if (password == "")
|
if (password == "")
|
||||||
reset_dialog (_("The password can't be empty."));
|
reset_dialog (_("The password can't be empty."));
|
||||||
|
@ -71,7 +75,7 @@ public class Vn.Users : Vn.Form
|
||||||
reset_dialog (_("Passwords do not match."));
|
reset_dialog (_("Passwords do not match."));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var batch = get ("password-batch") as Sql.Batch;
|
batch = get ("password-batch") as Sql.Batch;
|
||||||
var query = "SELECT user_set_password (#user, #pass)";
|
var query = "SELECT user_set_password (#user, #pass)";
|
||||||
conn.query_async (query, batch, on_password_changed);
|
conn.query_async (query, batch, on_password_changed);
|
||||||
}
|
}
|
||||||
|
@ -96,5 +100,36 @@ public class Vn.Users : Vn.Form
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
conn.query_async ("SELECT ssh_user, ssh_host FROM account_config",
|
||||||
|
null, on_user_received);
|
||||||
|
}
|
||||||
|
|
||||||
|
[CCode (instance_pos = -1)]
|
||||||
|
public void on_user_received (Db.Request request)
|
||||||
|
{
|
||||||
|
Db.Result result;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = request.fetch_result ();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
string user = user_entry.text;
|
||||||
|
|
||||||
|
unowned Db.Row row = result.data.get (0);
|
||||||
|
string ssh_user = row.@value[0].get_string ();
|
||||||
|
string ssh_host = row.@value[1].get_string ();
|
||||||
|
|
||||||
|
if (-1 == Posix.system
|
||||||
|
(@"ssh $ssh_user@$ssh_host "
|
||||||
|
+@"\"mkhomedir_helper $user "
|
||||||
|
+@"&& printf '$password\n$password\n' "
|
||||||
|
+@"| smbpasswd -a -s $user\""))
|
||||||
|
warning ("User home directory creation failed.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue