Skip to content

Commit a162bf7

Browse files
committed
Merge pull request #153 from dgets/user-profile-implementation
User profile implementation
2 parents ed024ec + ee377f4 commit a162bf7

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

ddoc2.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,11 @@ if (!debugOnly) {
838838
}
839839
}
840840
break;
841+
case 'p': //profile a user
842+
console.putmsg(green + high_intensity +
843+
"User to profile -> ");
844+
userRecords.userDataUI.profileUser(console.getstr());
845+
break;
841846
default:
842847
console.putmsg(excuse);
843848
break;

load/dperuser.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,36 @@ userRecords = {
256256
//terminology now)
257257

258258
// ----++++****====userDataUI methods====****++++----
259+
profileUser : function (uname) {
260+
var profileeSettings = { };
261+
var unum, uObj;
262+
263+
if ((unum = system.matchuser(uname)) == 0) {
264+
console.putmsg(yellow + high_intensity + "User " + green +
265+
uname + " was not found!\n");
266+
throw new dDocException("profileUser() Exception",
267+
"Unable to locate " + uname, 1);
268+
}
269+
270+
profileeSettings = userRecords.userDataIO.loadSettings(unum);
271+
uObj = new User(unum);
272+
273+
console.putmsg(cyan + high_intensity + uObj.alias + "\n" +
274+
yellow + high_intensity + uObj.address + "\n" +
275+
uObj.location + "\n");
276+
277+
if (profileeSettings == null) { //that is the error condition, no?
278+
console.putmsg(yellow + high_intensity + "User has not set up" +
279+
" profile information yet\n\n");
280+
} else {
281+
console.putmsg(high_intensity + green + "Doing: " + cyan +
282+
profileeSettings.doing + "\n\n");
283+
for each (var infoLine in profileeSettings.info) {
284+
console.putmsg(green + high_intensity + infoLine + "\n");
285+
}
286+
console.putmsg("\n");
287+
}
288+
},
259289
/*
260290
* summary:
261291
* obtains a new list of lines of text to utilize as the

0 commit comments

Comments
 (0)