The final project of the PHP course, a functional CMS site, containing different types of users, with different authentication levels.
This is an page that was made using the cms. Currently someone with Editor permissions is logged in, hence why you can see the edit link above the articles.
This would be how you could add articles. You could specify which page, content area, and whether or not to add to all pages. Once created you could also order Articles.
The ability to add pages, sections, articles were allowable to authors, editors could create and add articles, admins could manage users. Any user could have any number of permissions. The code below is from the User Controller class, showing the update function.
A OneNote clone, that allows you to use OAuth() to authenticate users with microsoft then sign them in with the acess token. From there using ajax calls you are able to add, modify, and delete notes in real time.
The difficulty in the application was mostly documentation, though it was also our first assignment relying completely on an API to get results.
function onLogin (session) {
if (!session.error) {
sess = session;
$.ajax({
url: "https://www.onenote.com/api/v1.0/me/notes/pages",
type: "GET",
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization','Bearer ' + sess.session.access_token);
},
success: function(data){
showElements();
var list = $('#Notes');
if(data.value != null){
notes = data;
console.log(data.value[0].body);
console.log(data.value[0].title);
$("#Body").val(data.value[0].body);
$("#NoteTitle").val(data.value[0].title);
for(var i = 0; i < data.value.length; i++){
if(i != 0){
list.append('<li id="wellnote' + i + '" class = "well well-sm">&l;ta id = "note' + i + '" onclick="displayNote('+i+')">' + data.value[i].title + "</a></li>");
}else{
list.append('<li id="wellnote' + i + '" class = "well active"><a id = "note' + i + '" onclick="displayNote('+i+')">' + data.value[i].title + '</a><i class=" fa fa-arrow-left" aria-hidden="true"></i></li>');
}
}//end for
}//end if
},
error: function(response) {
alert(response.status + " " + response.statusText);
console.log(response.statusText);
console.log(response);
console.log(response.status + " " + response.statusText);
}
});
WL.api({
path: "me",
method: "GET"
}).then(
function (response, session) {
console.log("Logged In.");
name = response.first_name + " " + response.last_name;
email = response.email;
},
function (responseFailed) {
alert("Error calling API: " + responseFailed.error.message);
}
);
}
else {
alert("Error signing in: " + session.error_description);
}
}