From a689b24db14436ab1faa2f2f79b9f27b777b1fdb Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 14 Oct 2001 12:10:29 +0000 Subject: the next step in the intl changeover. This should get us compiling agian, and also completes the switch to lang_tdb.c. SWAT should now work with a po file in the lib/ directory also removed useless SYSLOG defines in many files (This used to be commit 5296b20ad85d7519c870768455cb4d8df048c55a) --- source3/web/statuspage.c | 137 +++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 69 deletions(-) (limited to 'source3/web/statuspage.c') diff --git a/source3/web/statuspage.c b/source3/web/statuspage.c index b49fc7b656..6af7674dc9 100644 --- a/source3/web/statuspage.c +++ b/source3/web/statuspage.c @@ -20,7 +20,6 @@ */ #include "includes.h" -#include "webintl.h" #define PIDMAP struct PidMap @@ -40,7 +39,7 @@ static void initPid2Machine (void) { /* show machine name rather PID on table "Open Files"? */ if (PID_or_Machine) { - PIDMAP *p, *q; + PIDMAP *p; for (p = pidmap; p != NULL; ) { DLIST_REMOVE(pidmap, p); @@ -105,41 +104,41 @@ static char *tstring(time_t t) static void print_share_mode(share_mode_entry *e, char *fname) { - printf("%s",_(mapPid2Machine(e->pid))); - printf(""); + d_printf("%s",_(mapPid2Machine(e->pid))); + d_printf(""); switch ((e->share_mode>>4)&0xF) { - case DENY_NONE: printf(_("DENY_NONE")); break; - case DENY_ALL: printf(_("DENY_ALL ")); break; - case DENY_DOS: printf(_("DENY_DOS ")); break; - case DENY_READ: printf(_("DENY_READ ")); break; - case DENY_WRITE:printf(_("DENY_WRITE ")); break; + case DENY_NONE: d_printf("DENY_NONE"); break; + case DENY_ALL: d_printf("DENY_ALL "); break; + case DENY_DOS: d_printf("DENY_DOS "); break; + case DENY_READ: d_printf("DENY_READ "); break; + case DENY_WRITE:d_printf("DENY_WRITE "); break; } - printf(""); + d_printf(""); - printf(""); + d_printf(""); switch (e->share_mode&0xF) { - case 0: printf(_("RDONLY ")); break; - case 1: printf(_("WRONLY ")); break; - case 2: printf(_("RDWR ")); break; + case 0: d_printf("RDONLY "); break; + case 1: d_printf("WRONLY "); break; + case 2: d_printf("RDWR "); break; } - printf(""); + d_printf(""); - printf(""); + d_printf(""); if((e->op_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) == (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) - printf(_("EXCLUSIVE+BATCH ")); + d_printf("EXCLUSIVE+BATCH "); else if (e->op_type & EXCLUSIVE_OPLOCK) - printf(_("EXCLUSIVE ")); + d_printf("EXCLUSIVE "); else if (e->op_type & BATCH_OPLOCK) - printf(_("BATCH ")); + d_printf("BATCH "); else if (e->op_type & LEVEL_II_OPLOCK) - printf(_("LEVEL_II ")); + d_printf("LEVEL_II "); else - printf(_("NONE ")); - printf(""); + d_printf("NONE "); + d_printf(""); - printf("%s%s\n", + d_printf("%s%s\n", fname,tstring(e->time.tv_sec)); } @@ -179,15 +178,15 @@ static int traverse_fn2(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* st addPid2Machine (crec.pid, crec.machine); - printf("%d%s%s%s\n", + d_printf("%d%s%s%s\n", (int)crec.pid, crec.machine,crec.addr, tstring(crec.start)); if (geteuid() == 0) { - printf("\n", + d_printf("\n", (int)crec.pid); } - printf("\n"); + d_printf("\n"); return 0; } @@ -205,7 +204,7 @@ static int traverse_fn3(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void* st if (crec.cnum == -1 || !process_exists(crec.pid)) return 0; - printf("%s%s%s%d%s%s\n", + d_printf("%s%s%s%d%s%s\n", crec.name,uidtoname(crec.uid), gidtoname(crec.gid),(int)crec.pid, crec.machine, @@ -270,22 +269,22 @@ void status_page(void) initPid2Machine (); - printf("

%s

\n", _("Server Status")); + d_printf("

%s

\n", _("Server Status")); - printf("
\n"); + d_printf("\n"); if (!autorefresh) { - printf("\n", _("Auto Refresh")); - printf("
%s", _("Refresh Interval: ")); - printf("\n", + d_printf("\n", _("Auto Refresh")); + d_printf("
%s", _("Refresh Interval: ")); + d_printf("\n", refresh_interval); } else { - printf("\n", _("Stop Refreshing")); - printf("
%s%d\n", _("Refresh Interval: "), refresh_interval); - printf("\n"); + d_printf("\n", _("Stop Refreshing")); + d_printf("
%s%d\n", _("Refresh Interval: "), refresh_interval); + d_printf("\n"); } - printf("

\n"); + d_printf("

\n"); if (!tdb) { /* open failure either means no connections have been @@ -293,83 +292,83 @@ void status_page(void) } - printf("\n"); + d_printf("
\n"); - printf("", _("version:"), VERSION); + d_printf("", _("version:"), VERSION); fflush(stdout); - printf("\n", _("smbd:"), smbd_running()?_("running"):_("not running")); + d_printf("\n", _("smbd:"), smbd_running()?_("running"):_("not running")); if (geteuid() == 0) { if (smbd_running()) { - printf("\n", _("Stop smbd")); + d_printf("\n", _("Stop smbd")); } else { - printf("\n", _("Start smbd")); + d_printf("\n", _("Start smbd")); } - printf("\n", _("Restart smbd")); + d_printf("\n", _("Restart smbd")); } - printf("\n"); + d_printf("\n"); fflush(stdout); - printf("\n", _("nmbd:"), nmbd_running()?_("running"):_("not running")); + d_printf("\n", _("nmbd:"), nmbd_running()?_("running"):_("not running")); if (geteuid() == 0) { if (nmbd_running()) { - printf("\n", _("Stop nmbd")); + d_printf("\n", _("Stop nmbd")); } else { - printf("\n", _("Start nmbd")); + d_printf("\n", _("Start nmbd")); } - printf("\n", _("Restart nmbd")); + d_printf("\n", _("Restart nmbd")); } - printf("\n"); + d_printf("\n"); - printf("
%s%s
%s%s
%s%s
%s%s
%s%s
%s%s
\n"); + d_printf("\n"); fflush(stdout); - printf("

%s

\n", _("Active Connections")); - printf("\n"); - printf("\n", _("PID"), _("Client"), _("IP address"), _("Date")); + d_printf("

%s

\n", _("Active Connections")); + d_printf("
%s%s%s%s
\n"); + d_printf("\n", _("PID"), _("Client"), _("IP address"), _("Date")); if (geteuid() == 0) { - printf("\n", _("Kill")); + d_printf("\n", _("Kill")); } - printf("\n"); + d_printf("\n"); if (tdb) tdb_traverse(tdb, traverse_fn2, NULL); - printf("
%s%s%s%s%s%s

\n"); + d_printf("

\n"); - printf("

%s

\n", _("Active Shares")); - printf("\n"); - printf("\n\n", + d_printf("

%s

\n", _("Active Shares")); + d_printf("
%s%s%s%s%s%s
\n"); + d_printf("\n\n", _("Share"), _("User"), _("Group"), _("PID"), _("Client"), _("Date")); if (tdb) tdb_traverse(tdb, traverse_fn3, NULL); - printf("
%s%s%s%s%s%s

\n"); + d_printf("

\n"); - printf("

%s

\n", _("Open Files")); - printf("\n"); - printf("\n", _("PID"), _("Sharing"), _("R/W"), _("Oplock"), _("File"), _("Date")); + d_printf("

%s

\n", _("Open Files")); + d_printf("
%s%s%s%s%s%s
\n"); + d_printf("\n", _("PID"), _("Sharing"), _("R/W"), _("Oplock"), _("File"), _("Date")); locking_init(1); share_mode_forall(print_share_mode); locking_end(); - printf("
%s%s%s%s%s%s
\n"); + d_printf("\n"); if (tdb) tdb_close(tdb); - printf("
\n"); - printf("\n"); + d_printf("
\n"); + d_printf("\n"); - printf("
\n"); + d_printf("\n"); if (autorefresh) { /* this little JavaScript allows for automatic refresh of the page. There are other methods but this seems to be the best alternative */ - printf("\n"); + d_printf("//-->\n\n"); } } -- cgit