Sambastatus: my first module for nethserver

I plan to translate gecco’s post in English
@gecco could you add rpm part soon? it would be awesome.

1 Like

Good Job Bro!

Keep “Moduling” LoL

3 Likes

http://minucci.net/blog/849

4 Likes

another problem…

for add a new and fantastic feature on my module i try to make this

$command = “db accounts show domadmins”;
$admin = shell_exec($command);
echo “|” . $admin . “|”;

but don’t work
why?

if i put a php file in /tmp and then lauch it work

[root@server tmp]# cat prova.php

<?php $command = "db accounts show domadmins"; $admin = shell_exec($command); echo "|" . $admin . "|"; ?>

[root@server tmp]# php prova.php
|domadmins=group
Description=Domain Admins
Gid=503
Members=admin,minucci
Removable=no
|[root@server tmp]#

why?

1 Like

db is a privileged command: to execute it from the server-manager, run “sudo”!

1 Like

ok

there is another command, or trick, to found all user into the group domadmins?

The Unix way:

getent group domadmins

The Nethgui way:

$module->getPlatform()->getDatabase('accounts')->getProp('domadmins', 'Members');
1 Like

thanks, i change my code. now is:

$command = “getent group domadmins | cut -d “:” -f4”;
/* thanks to @davidep */

an exclusive preview of the new version of SambaStatus (now with italian translation)

10 Likes

:clap::clap::clap:

Absolutely great! Your little module becomes a project itself… I love it!

2 Likes

It’s great, @davidep how can @gecco improve it permitting string translations by transifex?
I’d like to see it in English and make it worldwide! :joy:

1 Like

it’s in english and in italian, i make two different file:

[root@server Language]# pwd
/usr/share/nethesis/NethServer/Language
[root@server Language]# find ./ -iname SambaStatus
./it/NethServer_Module_SambaStatus.php
./en/NethServer_Module_SambaStatus.php
[root@server Language]#

i think it is sufficient… or not?

2 Likes

Well, English was enough :smile: …because other languages are translated on Transifex.

To prepare your code for localization, a GitHub repository would help me on uploading the source strings to Transifex. Could you share your code on GitHub?

For more details:

http://docs.nethserver.org/projects/nethserver-devel/en/v7b/i18n.html

1 Like

i don’t know nothing about nethgui way, where i can found some documentation?

Have a look at

http://docs.nethserver.org/projects/nethserver-devel/en/v7b/create_interface_module.html

do you call it documentations? :smiley:

2 Likes

Feel free to try and follw those directions and extend the documentation with the information you come across. I am sure @davidep will help you with any step you have trouble with… :thumbsup:

1 Like

first step:

2 Likes

There is some deprecated documentation in github’s nethgui, maybe some points are still valid (@davidep?)
Also different components in use, like Mustache, jquery, datatables…

Just say it because I wasted some time looking at symfony and twig just to find out mustache was used for templates.

1 Like