Changeset dca3b27
- Timestamp:
- Oct 7, 2009, 5:05:57 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 77c87b2
- Parents:
- 6c171f1
- git-author:
- Karl Ramm <kcr@1ts.org> (09/23/09 10:51:42)
- git-committer:
- Karl Ramm <kcr@1ts.org> (10/07/09 17:05:57)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r340c3e7 rdca3b27 1941 1941 { 1942 1942 owl_fmtext fm; 1943 char *ptr, buff[LINE]; 1943 char *ptr; 1944 char *result; 1944 1945 int i; 1945 1946 … … 1947 1948 1948 1949 for (i=0; i<argc; i++) { 1949 ptr=long_zuser(argv[i]); 1950 owl_zephyr_zlocate(ptr, buff, auth); 1951 owl_fmtext_append_normal(&fm, buff); 1950 ptr = long_zuser(argv[i]); 1951 result = owl_zephyr_zlocate(ptr, auth); 1952 owl_fmtext_append_normal(&fm, result); 1953 owl_free(result); 1952 1954 owl_free(ptr); 1953 1955 } -
zephyr.c
rc79a047 rdca3b27 911 911 #endif 912 912 913 void owl_zephyr_zlocate(const char *user, char *out, int auth)913 char *owl_zephyr_zlocate(const char *user, int auth) 914 914 { 915 915 #ifdef HAVE_LIBZEPHYR … … 918 918 ZLocations_t locations; 919 919 char *myuser; 920 921 strcpy(out, ""); 920 char *p, *result; 921 922 922 ZResetAuthentication(); 923 ret=ZLocateUser(zstr(user),&numlocs,auth?ZAUTH:ZNOAUTH); 924 if (ret != ZERR_NONE) { 925 sprintf(out, "Error locating user %s\n", user); 926 return; 927 } 928 929 if (numlocs==0) { 930 myuser=short_zuser(user); 931 sprintf(out, "%s: Hidden or not logged in\n", myuser); 932 owl_free(myuser); 933 return; 934 } 935 936 for (;numlocs;numlocs--) { 937 ZGetLocations(&locations,&one); 938 myuser=short_zuser(user); 939 sprintf(out + strlen(out), "%s: %s\t%s\t%s\n", myuser, 940 locations.host ? locations.host : "?", 941 locations.tty ? locations.tty : "?", 942 locations.time ? locations.time : "?"); 943 owl_free(myuser); 944 } 923 ret = ZLocateUser(zstr(user), &numlocs, auth ? ZAUTH : ZNOAUTH); 924 if (ret != ZERR_NONE) 925 return owl_sprintf("Error locating user %s: %s\n", 926 user, error_message(ret)); 927 928 myuser = short_zuser(user); 929 if (numlocs == 0) { 930 result = owl_sprintf("%s: Hidden or not logged in\n", myuser); 931 } else { 932 result = owl_strdup(""); 933 for (; numlocs; numlocs--) { 934 ZGetLocations(&locations, &one); 935 p = owl_sprintf("%s%s: %s\t%s\t%s\n", 936 result, myuser, 937 locations.host ? locations.host : "?", 938 locations.tty ? locations.tty : "?", 939 locations.time ? locations.time : "?"); 940 owl_free(result); 941 result = p; 942 } 943 } 944 945 return result; 946 #else 947 return owl_strdup(""); 945 948 #endif 946 949 }
Note: See TracChangeset
for help on using the changeset viewer.